aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/utils/string_util.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2013-08-20 18:31:45 +0200
committerEinar Johan Trøan Sømåen2013-08-20 18:31:45 +0200
commit2049f536219e10ea1b5860fb1ce713bc7c63737b (patch)
treec00a9131272ea7ae1922779e1c4db49a79a4680a /engines/wintermute/utils/string_util.cpp
parentea19c4162d24d6bf32246671aa5fab285ca7ad39 (diff)
downloadscummvm-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.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!