diff options
author | Einar Johan Trøan Sømåen | 2013-08-20 18:31:45 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-08-20 18:31:45 +0200 |
commit | 2049f536219e10ea1b5860fb1ce713bc7c63737b (patch) | |
tree | c00a9131272ea7ae1922779e1c4db49a79a4680a /engines/wintermute/utils/string_util.cpp | |
parent | ea19c4162d24d6bf32246671aa5fab285ca7ad39 (diff) | |
download | scummvm-rg350-2049f536219e10ea1b5860fb1ce713bc7c63737b.tar.gz scummvm-rg350-2049f536219e10ea1b5860fb1ce713bc7c63737b.tar.bz2 scummvm-rg350-2049f536219e10ea1b5860fb1ce713bc7c63737b.zip |
WINTERMUTE: Replace CP1252-symbol ... with 3 full stops.
Diffstat (limited to 'engines/wintermute/utils/string_util.cpp')
-rw-r--r-- | engines/wintermute/utils/string_util.cpp | 23 |
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! |