This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: UTF-8 support - char or wchar_t?
Paolo Carlini wrote:
...
Thanks for pointing out 22.1.1.1.2, p4 and for the interesting
obervations.
However, I think you also see that all those "suggestions" ;) are
definitely
inconsistent with 27.8.1.1, p5, which is very clear.
Clear about what? It says how fstream obtains a reference to the
codecvt facet. It doesn't say that the (dynamic) type of the facet
is required to be codecvt.
If you're arguing that the standard only suggests but doesn't
actually require that locale("some name") contain any byname
facets you might very well be right since the standard doesn't
require implementations to support any named locales at all
(other than "C"), but an implementation that only goes as far
as the standard requires in the area of locales would be pretty
much useless to any internationalization project. A useful
implementation of codecvt_byname should correctly convert between
the internal and external representation even if they are both
char; it certainly should not corrupt data. If there is any text
in the standard that says otherwise, it is IMO a defect that
should be fixed. Otherwise there is no point in requiring that
codecvt_byname<char, char> even exist if it behaves identically
to the base class.
Martin