This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: read does not work with basic_ifstream< unsigned char >
- From: John Love-Jensen <eljay at adobe dot com>
- To: Luciano Montanaro <mikelima at gmail dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Fri, 06 Oct 2006 06:38:25 -0500
- Subject: Re: read does not work with basic_ifstream< unsigned char >
Hi Luciano,
You haven't plumbed up the facet, the locale, and/or the codecvt facilities
for your new stream's base type.
Some C++ compilers give you those things for char, and plumb char up to
locale facilities provided by the OS (e.g., the LC_ALL environment
variable).
Most C++ compilers give you those things for char and wchar_t, and, again,
plumb char and wchar_t up to locale facilities provided by the OS.
I don't know of any C++ compilers that provide you those things for unsigned
char, nor do I know of any OS that provides those facilities for unsigned
char.
Take a look at "Standard C++ IOStreams and Locales" by Angelika Langer and
Klaus Kreft, for all the gory details.
You'll be whipping up your own custom std::basic_ifstream<float> and
std::basic_ifstream<MyBigStruct> in no time.
HTH,
--Eljay