# HG changeset patch # User peter1138 # Date 2006-12-02 09:34:18 # Node ID e1025a2d1568968c33de3f32615e45d9868b1077 # Parent f64fbc33050a44c28de5539bdbbe0cc104dd8269 (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. diff --git a/newgrf_text.c b/newgrf_text.c --- a/newgrf_text.c +++ b/newgrf_text.c @@ -159,13 +159,13 @@ static char *TranslateTTDPatchCodes(cons 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 (;;) {