Changeset - r11963:3900948ab8b0
[Not reviewed]
master
0 1 0
peter1138 - 15 years ago 2009-05-22 12:05:28
peter1138@openttd.org
(svn r16374) -Fix (r11622): Valid UTF-8 sequences between 0x20 and 0xFF should be allowed as is instead of being treated as control codes.
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_text.cpp
Show inline comments
 
@@ -120,7 +120,13 @@ char *TranslateTTDPatchCodes(uint32 grfi
 
		if (unicode && Utf8EncodedCharLen(*str) != 0) {
 
			c = Utf8Consume(&str);
 
			/* '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 {
 
			c = (byte)*str++;
 
		}
0 comments (0 inline, 0 general)