Content deleted Content added
→Windows CE: Windows CE is dead, no expansion needed |
→Programming platforms: Old Source, Verification needed |
||
Line 35:
=== Programming platforms ===
Microsoft's compilers often fail at producing UTF-8 string constants from UTF-8 source files. The most reliable method is to turn ''off'' UNICODE, ''not'' mark the input file as being UTF-8 (i.e. do not use a [[UTF-8#Byte order mark|BOM]]), and arrange the string constants to have the UTF-8 bytes. If a BOM was added, a Microsoft compiler will interpret the strings as UTF-8, convert them to UTF-16, then convert them ''back'' into the current locale, thus destroying the UTF-8.<ref>[http://utf8everywhere.org/#faq.literal UTF-8 Everywhere FAQ: How do I write UTF-8 string literal in my C++ code?]</ref>{{Obsolete source|reason=This source seems more than 10 years old. (Citing Unicode 6.2). Can this contents be verified?|date=July 2024}} Without a BOM and using a single-byte locale, Microsoft compilers will leave the bytes in a quoted string unchanged. On modern systems setting the code page to UTF-8 helps considerably, but invalid byte sequences are still not preserved (using {{code|\x}} can work around this).
== See also ==
|