diff --git a/include/nana/deploy.hpp b/include/nana/deploy.hpp index f031c66d..342adfe7 100644 --- a/include/nana/deploy.hpp +++ b/include/nana/deploy.hpp @@ -121,6 +121,13 @@ namespace nana using std::runtime_error::runtime_error; +#if defined(_MSC_VER) +# if (_MSC_VER < 1900) + //A workaround for lack support of C++11 inheriting constructors for VC2013 + explicit utf8_Error(const std::string& msg); +# endif +#endif + void emit(); }; diff --git a/source/charset.cpp b/source/charset.cpp index 42fc386a..225cba40 100644 --- a/source/charset.cpp +++ b/source/charset.cpp @@ -1162,12 +1162,21 @@ namespace nana { switch(encoding) { +#if defined(NANA_WINDOWS) case unicode::utf8: return utf16_to_utf8(wcstr); case unicode::utf32: return utf16_to_utf32(wcstr); case unicode::utf16: return wcstr; +#else //POSIX + case unicode::utf8: + return utf32_to_utf8(wcstr); + case unicode::utf16: + return utf32_to_utf16(wcstr); + case unicode::utf32: + return wcstr; +#endif } } return {}; diff --git a/source/deploy.cpp b/source/deploy.cpp index eb79b86a..3e6dfcf7 100644 --- a/source/deploy.cpp +++ b/source/deploy.cpp @@ -513,6 +513,17 @@ namespace nana return true; } + //class utf8_Error + +#if defined(_MSC_VER) +# if (_MSC_VER < 1900) + //A workaround for lack support of C++11 inheriting constructors for VC2013 + utf8_Error::utf8_Error(const std::string& msg) + : std::runtime_error(msg) + {} +# endif +#endif + void utf8_Error::emit() { if (use_throw) @@ -522,6 +533,7 @@ namespace nana //bool utf8_Error::use_throw{true}; bool utf8_Error::use_throw{ false }; + //end class utf8_Error void throw_not_utf8(const std::string& text) {