Merge remote-tracking branch 'cnjinhao/hotfix-1.3' into geometric_scheme
This commit is contained in:
commit
b04c290ae7
@ -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();
|
||||
};
|
||||
|
||||
|
@ -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 {};
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user