Topic: iostream codesets (was forward declarations for iostreams)


Author: Nathan Myers <ncm@cantrip.org>
Date: 1996/05/10
Raw View
J. Kanze wrote:
>
> In article <4mltup$igb@engnews1.Eng.Sun.COM> clamage@Eng.Sun.COM (Steve
> Clamage) writes:
>
> |> The problem to be solved is that traditional iostreams are useful only for
> |> 8-bit localized character sets. Some change was necessary to accomodate
> |> other character sets, particularly when we notice that much of the
> |> world is moving from ASCII to Unicode. In addition, programs commonly
> |> must work in multi-language environments. Leaving iostreams alone was
> |> simply not an option.
>
> Agreed so far.  But...
>
> In practice, the only instantiaion types that are interesting are char
> and wchar_t.  On the other hand, I need several variations of char: one
> for ISO 8859-1, ISO 8859-2 ...

The Japanese representatives expressed a need for other instantiations.

> ... can imbue be used to tell wistream that it is in fact
> reading 8 bit ISO 8859-2.  This is actually three questions in one:
> does the standard require this (almost sure, no)?  Does the standard
> allow this?  And if the previous answers are no, yes, is it the intent
> of the standard that this should be the case (for systems using Unicode,
> at least)?

That is an intended use of locales and ios::imbue, if I understand your
question correctly.  Of course the standard doesn't require that vendors
provide such a built-in locale, but competitiveness will ensure they do,
eventually -- and if necessary you can get one from a third party and use
it.

Nathan Myers
ncm@cantrip.org
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]