Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

Converting to/from Uncode/Ansi with std::string

Started by Dean Harding May 23, 2002 at 6:06 AM 0 replies 850+ views
Original Post
Dean Harding
Dean Harding
Is there any (simple) way to convert between an Ansi string and a Unicode one using the std::string and std::wstring? The main reason I implement my own version of these classes is because there''s no way that I''m aware of to convert a std::string to a std::wstring (and vise versa). P.S. I''m looking for an equivalent to MultiByteToWideChar and WideCharToMultiByte - i.e. something that takes the code page into account...
codeka.com - Just click it.
Void
Void
There isn''t in C++. The C runtime library have mbstowc, mbtowc etc. which has probably mapped to the win32 functions. How portable those functions are, I haven''t a clue.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.