I don't think those functions do what you want them to 100%. On Windows
typically you'll want to convert to/from the *current code page* from/to
UTF-8. I'm unsure what the best name for the function is - ASCII is
incorrect as is ANSI - so I've gone with Microsoft's vague naming of
MultiByte.
I believe the attached files will do what you want. Note that on most
non-Windows operating systems e.g. OSX the code page will already be UTF-8
so conversion is unnecessary.


2010/1/27 Sukender <[email protected]>

> Hi Robert,
>
> Here is a tiny submission that allow the user to convert an extended 8-bit
> ASCII std::string to an UTF8 std::string, and vice-versa. Why? Because of
> the FBX plugin I'll submit in a few hours (I hope).
>
> BTW, should this header be moved in osg instead of osgDB? Actually
> conversion from and to ASCII/UTF8/UTF16 may be used from osgDB, osgText and
> so on. Well, just my two cents.
>
> Another remark: I saw conversions from/to UTF16 are Windows only. This may
> be addressed...
> Cheers,
>
> Sukender
> PVLE - Lightweight cross-platform game engine -
> http://pvle.sourceforge.net/
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>

Attachment: ConvertUTF.cpp
Description: Binary data

Attachment: ConvertUTF
Description: Binary data

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

Reply via email to