mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 04:13:26 +00:00
(svn r16374) -Fix (r11622): Valid UTF-8 sequences between 0x20 and 0xFF should be allowed as is instead of being treated as control codes.
This commit is contained in:
parent
6afce484bb
commit
b37fda664c
@ -120,7 +120,13 @@ char *TranslateTTDPatchCodes(uint32 grfid, const char *str)
|
|||||||
if (unicode && Utf8EncodedCharLen(*str) != 0) {
|
if (unicode && Utf8EncodedCharLen(*str) != 0) {
|
||||||
c = Utf8Consume(&str);
|
c = Utf8Consume(&str);
|
||||||
/* 'Magic' range of control codes. */
|
/* 'Magic' range of control codes. */
|
||||||
if (GB(c, 8, 8) == 0xE0) c = GB(c, 0, 8);
|
if (GB(c, 8, 8) == 0xE0) {
|
||||||
|
c = GB(c, 0, 8);
|
||||||
|
} else if (c >= 0x20) {
|
||||||
|
if (!IsValidChar(c, CS_ALPHANUMERAL)) c = '?';
|
||||||
|
d += Utf8Encode(d, c);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
c = (byte)*str++;
|
c = (byte)*str++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user