News for hackers. Stuff that matters.
Re:UTF-8 Everywhere (2012) by paulddraper on Tuesday June 21, 2016 @12:04PM (#11946719)
Think of JSON.

The programmer shouldn't have to know that a newline character is written as \n in a JSON string.

The JSON string "a\nb" take 6 characters to write, but it's length should be given as 3.

99% people want to manipulate a JSON model, not the JSON (or BSON) serialization itself. The 1% can still use a byte array and do whatever hacks they like.

Re:UTF-8 Everywhere (2012) by Avernar on Tuesday June 21, 2016 @01:41PM (#11947662)
Bad example. If you want to embed that string in your code you have to type those 6 characters anyways.

A better example is if you want to find a newline in a string. If you do a find it in a UTF-16 string it may be position 8 and a find in UTF-8 may be position 12. Does it matter what the actual number is? NO. You just pass it to the next function or whatever.