From 9bfd73889aeffed11e56d7d95ec36a7521b46a98 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 2 Dec 2006 09:34:18 +0000 Subject: (svn r7323) -Fix (r7182): When translating NewGRF strings, look at the first character and move ahead if needed, instead of taking the first character and moving back. --- newgrf_text.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/newgrf_text.c b/newgrf_text.c index 3afffb959..e8d606d78 100644 --- a/newgrf_text.c +++ b/newgrf_text.c @@ -159,13 +159,13 @@ static char *TranslateTTDPatchCodes(const char *str) char *tmp = malloc(strlen(str) * 10 + 1); /* Allocate space to allow for expansion */ char *d = tmp; bool unicode = false; - WChar c = Utf8Consume(&str); + WChar c; + size_t len = Utf8Decode(&c, str); if (c == 0x00DE) { /* The thorn ('รพ') indicates a unicode string to TTDPatch */ unicode = true; - } else { - str--; + str += len; } for (;;) { -- cgit v1.2.3-70-g09d2