In theory, nothing prevents wchar_t to be 16 bits and signed,
...so better safe than sorry.
This commit is contained in:
parent
483d196342
commit
6bdfa0af2f
1 changed files with 3 additions and 3 deletions
|
@ -561,7 +561,7 @@ utf8_string capitalize(const utf8_string& s)
|
|||
#ifdef __APPLE__
|
||||
// FIXME: Should we support towupper on recent OSX platforms?
|
||||
wchar_t uchar = *itor;
|
||||
if(uchar < 256)
|
||||
if(uchar >= 0 && uchar < 0x100)
|
||||
uchar = toupper(uchar);
|
||||
std::string res = utils::wchar_to_string(uchar);
|
||||
#else
|
||||
|
@ -583,7 +583,7 @@ utf8_string uppercase(const utf8_string& s)
|
|||
#ifdef __APPLE__
|
||||
// FIXME: Should we support towupper on recent OSX platforms?
|
||||
wchar_t uchar = *itor;
|
||||
if(uchar < 256)
|
||||
if(uchar >= 0 && uchar < 0x100)
|
||||
uchar = toupper(uchar);
|
||||
res += utils::wchar_to_string(uchar);
|
||||
#else
|
||||
|
@ -606,7 +606,7 @@ utf8_string lowercase(const utf8_string& s)
|
|||
#ifdef __APPLE__
|
||||
// FIXME: Should we support towupper on recent OSX platforms?
|
||||
wchar_t uchar = *itor;
|
||||
if(uchar < 256)
|
||||
if(uchar >= 0 && uchar < 0x100)
|
||||
uchar = tolower(uchar);
|
||||
res += utils::wchar_to_string(uchar);
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue