Closed stevewgr closed 1 month ago
I ran some investigation on why would the new .gitattributes
configurations messes up in the wrong way, where it tries to take a perfectly fine UTF-16-LE encoded RC file and rencode it from UTF-8 to UTF-16. This seems like an unexpected behavior from gitattributes, and hence I removed these configs: https://github.com/ko4life-net/ko/pull/241/commits/317d79598a439dbac4c3eada2e59302c005320a2
I initially added them so that when I run from the terminal git diff
, I'll be able to see the content, since git doesn't handle well with UTF-16 encoded files and treat them as binary instead of text.
However UI based diffing still works in vscode and some other diffing tools, so let's remove these configs from .gitattributes
and merge this PR.
Also there are some work around in case someone still want to see the diff of UTF-16 encoded text files by changing the default diff tool: https://stackoverflow.com/questions/777949/can-i-make-git-recognize-a-utf-16-file-as-text
I tested the build on multiple scenarios and they seem to all pass perfectly fine:
Thanks for the review @xGuTeK and @srmeier 🚀
Description
Resolves the following issue: https://github.com/ko4life-net/ko/issues/240
This PR introduces the following changes:
Standardized and normalized file encoding across the project by transcoding all text-based files to UTF-8. This ensures compatibility with modern systems and supports multiple languages, specifically Korean, Chinese, and Polish characters. Microsoft's resource files (
*.rc
) are exempt and transcoded to UTF-16 Little Endian (LE byte order) with a Byte Order Marker (BOM).Converted all Windows CRLF line endings to Unix LF to ensure cross-platform compatibility and consistency in various editors.
Implemented a python script to automate the encoding standardization and line ending conversion.
Configured
.gitattributes
to handle*.rc
files as text with UTF-16 encoding, preventing them from being misinterpreted as binary and ensuring proper diff display.Added a
.editorconfig
file to enforce encoding consistency for future files and modifications.Workflow
Results
ko-encoding-manual.csv
ko-encoding.csv
Log files