www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - wistream (Am I crazy?)

I have an wifstream object.

I am using this to read a UNICODE file into wchar_t
a character at a time. Unfortunately it seems not to be
working as I expected.

I have been trying to read the documentation for streams and
cant seem to find a definitive answer that satisfies me. The
documentation specifies that a "character" is read from the file.
I was assuming that the actual type of character depended on
the specialization (char or wchar_t).

I was expecting each get() to read one 16 bit (wchar_t) value
at a time. But what seems to be happening is that it reads
1 8 bit (char) value at a time and places it into a wchar_t.


Is this the correct behavior. If so how do you go about specializing
a stream so that it reads 16 bit values?
Jan 15 2002