std::string <-> std::wstring conversion?
Hi, I saw a thread from 4 years ago on this topic here: http://lists.boost.org/Archives/boost/2004/12/77721.php is there any definitive way to go since then? Akos
On Sun, 06 Jul 2008 22:50:29 +0200, Ákos Maróy
Hi,
I saw a thread from 4 years ago on this topic here:
http://lists.boost.org/Archives/boost/2004/12/77721.php
is there any definitive way to go since then?
You can use std::mbstowcs and std::wcstombs (in <cstdlib>). Boris
On Tue, 08 Jul 2008 10:10:29 +0200, Ákos Maróy
Boris,
You can use std::mbstowcs and std::wcstombs (in <cstdlib>).
I see. But it doesn't look too elegant, does it, as one has to create an array to convert the characters into, and then initialise std::string or std::wstring with the results, right?
ICU provides some elegant classes (see http://www.icu-project.org/). But depending on what you want to do exactly it might be overkill. Boris
Boris,
ICU provides some elegant classes (see http://www.icu-project.org/). But depending on what you want to do exactly it might be overkill.
Yes, you're right - ICU is a big dependency, it's an overkill for what I need. Thanks for the pointers.. Akos
participants (2)
-
Boris
-
Ákos Maróy