How to set the locale::global to utf8 encoding?
- From: Dancefire <Dancefire@xxxxxxxxx>
- Date: 29 Apr 2007 08:16:59 -0700
Hi,
I try to set the global locale to "utf8" to let the mbstowcs()
function works for convert a utf8 string to an wchar_t*. I tried the
following code:
std::locale loc(".65001");
std::locale::global(loc);
But I failed at the first line, which I try to create a locale object
which code page is 65001(utf8). When I looked into the VC STL code, I
found in the implementation, there is a line to determine whether I
try to use UTF8 or UTF7, if I do, the function will return without
doing anything useful.
What is the problem? Can I set locale::global() to UTF8?
Thanks.
.
- Follow-Ups:
- Re: How to set the locale::global to utf8 encoding?
- From: Darko Miletic
- Re: How to set the locale::global to utf8 encoding?
- Prev by Date: Re: std::Queue leaking memory
- Next by Date: Re: How to set the locale::global to utf8 encoding?
- Previous by thread: Re: Map Question
- Next by thread: Re: How to set the locale::global to utf8 encoding?
- Index(es):
Relevant Pages
|