diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2009-09-08 11:59:08 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2009-09-08 11:59:08 -0230 |
commit | 8b8099e48a61b10d456f728f2a5a979448e31a1c (patch) | |
tree | bc66ff2dcc993243f43906e209d841d6cc684d06 /cpp/src | |
parent | Bug 4244 - simplify callback demo (diff) | |
download | ice-8b8099e48a61b10d456f728f2a5a979448e31a1c.tar.bz2 ice-8b8099e48a61b10d456f728f2a5a979448e31a1c.tar.xz ice-8b8099e48a61b10d456f728f2a5a979448e31a1c.zip |
Bug 4246 - tolower/toupper on modify ascii
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceUtil/StringUtil.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cpp/src/IceUtil/StringUtil.cpp b/cpp/src/IceUtil/StringUtil.cpp index 567f4143584..b83d6dc8a79 100644 --- a/cpp/src/IceUtil/StringUtil.cpp +++ b/cpp/src/IceUtil/StringUtil.cpp @@ -700,7 +700,14 @@ IceUtilInternal::toLower(const std::string& s) result.reserve(s.size()); for(unsigned int i = 0; i < s.length(); ++i) { - result += tolower(static_cast<unsigned char>(s[i])); + if(isascii(s[i])) + { + result += tolower(static_cast<unsigned char>(s[i])); + } + else + { + result += s[i]; + } } return result; } @@ -712,7 +719,14 @@ IceUtilInternal::toUpper(const std::string& s) result.reserve(s.size()); for(unsigned int i = 0; i < s.length(); ++i) { - result += toupper(static_cast<unsigned char>(s[i])); + if(isascii(s[i])) + { + result += toupper(static_cast<unsigned char>(s[i])); + } + else + { + result += s[i]; + } } return result; } |