ASCII is valid UTF-8, there is no need for conversion. You may be referring to "Extended ASCII" of which there is no definitive version (see http://en.wikipedia.org/wiki/Extended_ASCII). If the intended usage is to convert from an 8-bit filename provided by the operating system (e.g. using a open-file dialog) then the functions I have provided are what is required.
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Sukender Sent: 28 January 2010 08:11 To: OpenSceneGraph Submissions Subject: Re: [osg-submissions] Convert ASCII <-> UTF8 Hi Michael and Robert, Well I followed what was in osgText::String an in http://en.wikipedia.org/wiki/Utf8 It was my intent to have ASCII <-> UTF8 functions. However I agree "current codepage" <-> UTF8 could be nice. So...? Will we keep both? Cheers, -- Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Wed, 27 Jan 2010 20:50:23 +0100, Michael Platings <[email protected]> a écrit: > 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-openscen >> egraph.org >> >> _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ ______________________________________________________________________ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
