summaryrefslogtreecommitdiff
path: root/src/locale_convert.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-15 16:03:33 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-15 16:03:33 +0100
commit5f61c01c7759e1420adbf201a8ccf01beac1536d (patch)
tree5a3fbed8e147b479cb41667eb37485492b48a431 /src/locale_convert.cc
parent124adae15126598fc46f3189aa7e4ab44582b8dc (diff)
Add locale_convert from wchar_t.
Diffstat (limited to 'src/locale_convert.cc')
-rw-r--r--src/locale_convert.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/locale_convert.cc b/src/locale_convert.cc
index ca6f6552..fc156244 100644
--- a/src/locale_convert.cc
+++ b/src/locale_convert.cc
@@ -36,6 +36,7 @@
#include <inttypes.h>
using std::string;
+using std::wstring;
template<>
string
@@ -152,6 +153,14 @@ dcp::locale_convert (char const * x, int, bool)
template<>
string
+dcp::locale_convert (wchar_t const * x, int, bool)
+{
+ wstring s (x);
+ return string (s.begin(), s.end());
+}
+
+template<>
+string
dcp::locale_convert (char x, int, bool)
{
string s;