From a646936fb18ba757e8c86b192c3995e808990845 Mon Sep 17 00:00:00 2001 From: Retro-Junk Date: Tue, 6 Sep 2016 22:04:47 +0300 Subject: FULLPIPE: Use cp866 for logging on Windows build --- engines/fullpipe/utils.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'engines/fullpipe') diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 148f779d1e..de7cbbbaab 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -473,6 +473,19 @@ byte *transCyrillic(byte *s) { int i = 0; for (byte *p = s; *p; p++) { +#ifdef WIN32 + // translate from cp1251 to cp866 + byte c = *p; + if (c >= 0xC0 && c <= 0xEF) + c = c - 0xC0 + 0x80; + else if (c >= 0xF0 && c <= 0xFF) + c = c - 0xF0 + 0xE0; + else if (c == 0xA8) + c = 0xF0; + else if (c == 0xB8) + c = 0xF1; + tmp[i++] = c; +#else if (*p < 128) { tmp[i++] = *p; } else { @@ -487,6 +500,7 @@ byte *transCyrillic(byte *s) { assert(trans[j]); } +#endif } tmp[i] = 0; -- cgit v1.2.3