News for hackers. Stuff that matters.
Re:Plain Text Doesn’t Exist: Unicode and encodings demystified by KayEss on Monday August 26, 2013 @04:50AM (#6275881)
>UTF-16 does not suffer from that particular problem

what about surrogate pairs? You can't have only one 16 bit word for a pair and have a valid UTF-16 sequence. This problem is real easy to do if you substring a UTF-16 sequence naively.

Re:Plain Text Doesn’t Exist: Unicode and encodings demystified by millstone on Monday August 26, 2013 @12:38PM (#6278101)
Right, there's still plenty of ways you can screw up a string. My point was merely that UTF-8 has one failure mode (invalid code units) that UTF-16 does not suffer from, and that has implications in encoding converters and APIs.