Hacker News new | ask | show | jobs
by PawelDecowski 3288 days ago
UTF-8, Unicode.
2 comments

What if you are using another encoding that already works for you? Same as real life alphabets and such?
Convert it to UTF-8 or UTF-16 and call it a day.

Let the fractured world of code pages rest in peace. Unicode may not be perfect, but it sure beats the alternatives.

> or UTF-16

Please no. UTF-16 needs to die a painful death.

And how do you represent line breaks?
For most users, you press enter/return on your keyboard. A lot of text editors will detect line endings when opening a file and use that going forward.
CRLF unless your audience mostly use Mac or Linux.
It seems to me the only thing on Windows that cares about CRLF is Notepad.

Everything else works fine with just LF. A lot of new Windows software even seems to ship with LF format configuration files. Especially games, probably because it is so common to have a Windows game with Linux backend servers, so the developers are working with both.

So anyway, I'd go with just LF unless your software is Windows only.