OK, this is annoying. I made the mistake of using Git on Windows. I generated a patch which I sent to a Linux machine to be merged.

Of course nothing worked.

Why? Well, first of all the entire file was UTF-16, because of course it was. Then there was CRLF line endings. That wouldn't be too much of a problem, except for the fact that the damn thing had somehow managed to save UTF-8 encoded characters, parsed as Latin-1 and then stored as UTF-16.

I had to change all the broken characters manually in the patch prior to merging it.

Why is encoding problems a thing in 2023? And why it it only Windows that suffers from it?

Follow

@loke I recently wrote a NTLM hash prog in C, first UTF-8 to UTF-16LE conversion of input string, then MD4 hash of that. ;( Weird meets deprecated.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.