News for hackers. Stuff that matters.
Re:UTF-8 good, UTF-16 bad by fnl on Tuesday February 08, 2011 @06:34AM (#2192587)
The important fact lies in the last sentence; in all of my apps, I could so far safely and soundly ignore the fact that Surrogates are two characters long to establish character lengths. So by using UTF-16, all those apps are significantly faster than one that would have been based on UTF-8. And, to add to this, by the same nature, it is far easier to take char slices of a UTF-16 encoded byte array than of a UTF-8 one.
Re:UTF-8 good, UTF-16 bad by querulous on Wednesday February 09, 2011 @03:59AM (#2196875)
how do you ensure you are not slicing a character in two? for example, how do you prevent slicing 2⁵ in half?