Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 2
    Only use UTF-8 when working with string and char. Use UTF-8 for output. The only unusual problem is that UCS-2 != UTF-16, since Chinese has some codepoints that require two code-units (i.e. one codepoint that consists of two chars) Commented Mar 14, 2013 at 15:51
  • 4
    Related: Should UTF-16 be considered harmful? Commented Mar 14, 2013 at 15:53
  • 4
    Your understanding is incorrect. You do not need to use UTF-16 everywhere. UTF-8 represents all Unicode characters, is more appropriate for a web app, and is arguably less likely to have Chinese-specific breakage than UTF-16. Commented Mar 14, 2013 at 16:54
  • I agree, after reading about endiness and var length, UTF-8 makes more sense overall. I was just looking for feedback, One of the devs on this project had recommended utf-16 but after reading about it has had no supporting reason. Commented Mar 14, 2013 at 16:58