1
0

Fix unicode handling in StringUtils::TrimString

This commit is contained in:
LogicParrot 2016-02-16 16:53:53 +02:00
parent 3c272b55ea
commit f405c8820e

View File

@ -222,7 +222,7 @@ AString TrimString(const AString & str)
size_t start = 0; size_t start = 0;
while (start < len) while (start < len)
{ {
if (str[start] > 32) if (static_cast<unsigned char>(str[start]) > 32)
{ {
break; break;
} }
@ -236,7 +236,7 @@ AString TrimString(const AString & str)
size_t end = len; size_t end = len;
while (end >= start) while (end >= start)
{ {
if (str[end] > 32) if (static_cast<unsigned char>(str[end]) > 32)
{ {
break; break;
} }