Re: ifstream and unicode
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Wed, 7 Jun 2006 08:07:10 -0700
Andrew Jarvis wrote:
Dear All,
It seems that basic_ifstream<wchar_t> reads the file as char and
translates the input to wchar_t.
Is there a stream class that will read a file that contains unicode?
What you need is a codecvt facet. IIRC, the default codecvt facet used by
VC++ wifstream assumes that the file is UTF-8.
http://www.dinkumware.com/libDCorX.html
....includes a number of useful character conversion facets including the
trivial UTF-16 -> UTF-16 conversion that you're looking for.
-cd
.
- Follow-Ups:
- Re: ifstream and unicode
- From: Andrew Jarvis
- Re: ifstream and unicode
- References:
- ifstream and unicode
- From: Andrew Jarvis
- ifstream and unicode
- Prev by Date: Re: ifstream and unicode
- Next by Date: Re: ifstream and unicode
- Previous by thread: Re: ifstream and unicode
- Next by thread: Re: ifstream and unicode
- Index(es):