aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/utils/string_util.cpp
diff options
context:
space:
mode:
authorStrangerke2013-09-11 21:33:10 +0200
committerStrangerke2013-09-11 21:33:10 +0200
commitda1a427e794434a09cd39ab45e32ae7afca9a170 (patch)
tree85b4700515bc7853e4f90ddae22bc3b785c4ab3a /engines/wintermute/utils/string_util.cpp
parent49dbac6a2a5cde294a4c4c9a47467e7b5d95e08b (diff)
parent5c6ee7573c0cf05bbbb154d4734e94e478f453e5 (diff)
downloadscummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.tar.gz
scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.tar.bz2
scummvm-rg350-da1a427e794434a09cd39ab45e32ae7afca9a170.zip
Merge branch 'master' of https://github.com/urukgit/scummvm into avalanche
Diffstat (limited to 'engines/wintermute/utils/string_util.cpp')
-rw-r--r--engines/wintermute/utils/string_util.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/engines/wintermute/utils/string_util.cpp b/engines/wintermute/utils/string_util.cpp
index 23abb5d579..e8e078aba8 100644
--- a/engines/wintermute/utils/string_util.cpp
+++ b/engines/wintermute/utils/string_util.cpp
@@ -146,26 +146,21 @@ Utf8String StringUtil::wideToUtf8(const WideString &WideStr) {
return "";
}
-// Currently this only does Ansi->ISO 8859, and only for carets.
-char simpleAnsiToWide(const AnsiString &str, uint32 &offset) {
- byte c = str[offset];
-
- if (c == 146) {
- offset++;
- return 39; // Replace right-quote with apostrophe
- } else {
- offset++;
- return c;
- }
-}
-
//////////////////////////////////////////////////////////////////////////
WideString StringUtil::ansiToWide(const AnsiString &str) {
// TODO: This function gets called a lot, so warnings like these drown out the usefull information
Common::String converted = "";
uint32 index = 0;
while (index != str.size()) {
- converted += simpleAnsiToWide(str, index);
+ byte c = str[index];
+ if (c == 146) {
+ converted += (char)39; // Replace right-quote with apostrophe
+ } else if (c == 133) {
+ converted += Common::String("..."); // Replace ...-symbol with ...
+ } else {
+ converted += c;
+ }
+ index++;
}
// using default os locale!