From e9c381e1de321385f07bcec78c5de7a1fab4d01d Mon Sep 17 00:00:00 2001 From: unitrunker Date: Sun, 21 Jan 2018 23:53:09 -0600 Subject: [PATCH] Unicode fix for using iconv on little-endian machines. --- source/detail/platform_spec_posix.cpp | 4 ++-- source/gui/detail/bedrock_posix.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/detail/platform_spec_posix.cpp b/source/detail/platform_spec_posix.cpp index 914bc529..853f4df1 100644 --- a/source/detail/platform_spec_posix.cpp +++ b/source/detail/platform_spec_posix.cpp @@ -339,8 +339,8 @@ namespace detail string.tab_pixels = 0; string.whitespace_pixels = 0; #if defined(NANA_USE_XFT) - conv_.handle = ::iconv_open("UTF-8", "UTF-32"); - conv_.code = "UTF-32"; + conv_.handle = ::iconv_open("UTF-8", NANA_UNICODE); + conv_.code = NANA_UNICODE; #endif } diff --git a/source/gui/detail/bedrock_posix.cpp b/source/gui/detail/bedrock_posix.cpp index 16273989..9609fe7f 100644 --- a/source/gui/detail/bedrock_posix.cpp +++ b/source/gui/detail/bedrock_posix.cpp @@ -981,7 +981,7 @@ namespace detail { const wchar_t* charbuf; - nana::detail::charset_conv charset("UTF-32", "UTF-8"); + nana::detail::charset_conv charset(NANA_UNICODE, "UTF-8"); const std::string& str = charset.charset(std::string(keybuf, keybuf + len)); charbuf = reinterpret_cast(str.c_str()) + 1; len = str.size() / sizeof(wchar_t) - 1;