compilation of UTF-8 in visual cpp
-
hi all Is it possible to compile UTF-8 build in visual cpp or is it neccessary to convert it to UTF-16? if it is possible do let me know ho it is possible. thanks in advance
-
hi all Is it possible to compile UTF-8 build in visual cpp or is it neccessary to convert it to UTF-16? if it is possible do let me know ho it is possible. thanks in advance
-
hi all Is it possible to compile UTF-8 build in visual cpp or is it neccessary to convert it to UTF-16? if it is possible do let me know ho it is possible. thanks in advance
puneet_cha wrote:
compile UTF-8 build in visual cpp or is it neccessary to convert it to UTF-16?
Neither option is available. The "Unicode" option was put in place back when "Unicode" was only 16-bits and did not use surrogate pairs or groups. The term UCS-2 is probably closer to Windows "Unicode" or the compiler "Unicode" option. UTF-16 has 16-bit code units but can use surrogate pairs to represent unicode code points that require more than 16-bits to represent them. Windows "Unicode" is simply 16-bits for every code point, no more, no less. UCS-2 and UTF-16 map the same but the code units that are used to represent the first part of a surrogate grouping in UTF-16 are ignored in UCS-2. However, UCS-2 and UTF-16 as well as the term "Unicode" are still mistakenly used interchangeably which causes some confusion.
-
puneet_cha wrote:
compile UTF-8 build in visual cpp or is it neccessary to convert it to UTF-16?
Neither option is available. The "Unicode" option was put in place back when "Unicode" was only 16-bits and did not use surrogate pairs or groups. The term UCS-2 is probably closer to Windows "Unicode" or the compiler "Unicode" option. UTF-16 has 16-bit code units but can use surrogate pairs to represent unicode code points that require more than 16-bits to represent them. Windows "Unicode" is simply 16-bits for every code point, no more, no less. UCS-2 and UTF-16 map the same but the code units that are used to represent the first part of a surrogate grouping in UTF-16 are ignored in UCS-2. However, UCS-2 and UTF-16 as well as the term "Unicode" are still mistakenly used interchangeably which causes some confusion.
bob16972 wrote:
Neither option is available.
Or is it? I got to thinking, and I've not checked VC++ 2005 or beyond. Do they still use "MBCS" and "UNICODE" for compiler options or have they finally started using encoding terms to describe the options. Does VC++ 2005 or beyond use "UTF-16" and "UTF-8" instead of "MBCS" and "UNICODE" for the compiler options. I came across a blog stating that Windows XP and above started supporting surrogates so it could be officially called UTF-16 on those operating systems. However, this would conflict with the wide character nature of BSTR and wide chars so I'm guessing the surrogates would still be illegal code units. Anyone have any info?
-
hi all Is it possible to compile UTF-8 build in visual cpp or is it neccessary to convert it to UTF-16? if it is possible do let me know ho it is possible. thanks in advance
UTF-8 is not supported natively in Windows. Your choices are MBCS or UTF-16 ("Unicode"). You'll need to convert your strings to UTF-8 manually whenever you need UTF-8.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Hungarian notation FTW