Hi,

> I would then recommend to keep OSG use "narrow" std::string, and have a
> flag somewhere (Some singleton? Registry? ReaderWriter::Options?) which
> says if filenames use a (8-bit) code page or UTF8. Having "wide" UTF16
> overloads may be possible too (even if conversion functions are enough).
> Thoughts?
Filenames should use the systems encoding. Which is determined by LANG/LC_* on 
UNIX and the active code page on windows.
Library wise there are functions which do exactly the right thing in 
libc/msvcrt. Which mbstowcs and wcstombs which convert from wchar_t 
representations to the current multibyte narrow char representation which can 
be used by narrow char file functions.
Also note that the win32 16 bit wchar_t strings are meant to be UTF-16 since 
at least vista. Which means all the wchar_t interfaces in windows also work 
for really all languages' character sets. The same holds for the usual linux 
32 bit wchar_t which is also sufficient for all known unicode glyphs.
Using these functions appears to me the most system compatible way. They just 
implement the systems way of handling character encoding. You do not need to 
know anything how this is done.

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to