summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newgrf_text.c6
1 files 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 (;;) {