This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

character encoding (locale)


I watched the sources and your documentation quite a while. As I still have
no copy of the standard (don't ask) there is one question I have.
Can a program in any way determined by the standard get the character
encoding of a file in a just opened stream. I don't mean the locales in ios or
the connected streambuf. I mean how do you get the encoding of a plain text
file.

When you do a 

ifstream in("text.txt");

or

wifstream in("text.txt");

both locales (the one of the ios and the one of the connected streambuf)
are initialized. But this can be the wrong locale. So you have to get the
right one by parsing the file or something likewise?

Jan Schukat

-- 
Sent through GMX FreeMail - http://www.gmx.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]