Need Guidance: Porting locales, wide character specializations

AWLaFramboise@aol.com AWLaFramboise@aol.com
Wed Jan 29 04:13:00 GMT 2003


Hi,

I'm interested in getting libstdc++-v3's wide character specializations
(std::wcout etc), as well as general locale stuff, working on my system
(win32).

The things configure seems to want to enable wchar: fairly complete support
of c99 <wchar.h>, iconv, and langinfo.  Getting the first is simple
enough, but what about iconv and langinfo?  Win32 does not have a native
notion of either.  While GNU libiconv works for win32, there is no
drop-in version of langinfo (which apparently is tied to the C library
[it bugs me how unix does not distinguish between the C library and
the rest of the OS]).  I'm assuming all of this stuff is needed by the
codecvt facet (although, honestly, it seems a bit excessive :( )

In addition, other parts of locales seem to require other things

I'm wondering what the 'right' way would be to get wchar (and the rest of
my locales) working on my system.  Specifically, I am interested in
correctness, but also in quality of implementation and reusability.
Eg, I'd like to be able to have std::codecvt use my installed
windows codepages, and std::time_put reflect what I specify in the
windows control panel.

I was considering implementing iconv and langinfo as wrappers for my
system's native nls interface, but there is a problem: I do not have
source code access to (or I don't want to mess with) the C library,
yet langinfo seems like it needs to be implemented by the C library
if it is to be kept in synch with the C library locales, which seems
like a requirement to reasonable design (and the unix spec, too).
So, I am uncertain of how to approach this.

Any guidance or references or pointers or explainations would be
appreciated.

Aaron W. LaFramboise - AaronWL



More information about the Libstdc++ mailing list