In theory, nothing prevents wchar_t to be 16 bits and signed,

...so better safe than sorry.
This commit is contained in:
Philippe Plantier 2005-04-24 12:21:19 +00:00
parent 483d196342
commit 6bdfa0af2f

View file

@ -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