--- a/hedgewars/uStore.pas Thu Jan 07 22:49:25 2010 +0000
+++ b/hedgewars/uStore.pas Thu Jan 07 22:59:14 2010 +0000
@@ -762,19 +762,19 @@
begin
if font >= CJKfntSmall then exit(font);
-l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), 255);
+l:= Utf8ToUnicode(@tmpstr, Str2PChar(s), length(s))-1;
i:= 0;
while i < l do
begin
u:= tmpstr[i];
if (#$2E80 <= u) and (
- (u >= #$2FDF ) or // CJK Radicals Supplement / Kangxi Radicals
- ((#$2FF0 <= u) and (u >= #$303F)) or // Ideographic Description Characters / CJK Radicals Supplement
- ((#$31C0 <= u) and (u >= #$31EF)) or // CJK Strokes
- ((#$3200 <= u) and (u >= #$4DBF)) or // Enclosed CJK Letters and Months / CJK Compatibility / CJK Unified Ideographs Extension A
- ((#$4E00 <= u) and (u >= #$9FFF)) or // CJK Unified Ideographs
- ((#$F900 <= u) and (u >= #$FAFF)) or // CJK Compatibility Ideographs
- ((#$FE30 <= u) and (u >= #$FE4F))) // CJK Compatibility Forms
+ (u <= #$2FDF ) or // CJK Radicals Supplement / Kangxi Radicals
+ ((#$2FF0 <= u) and (u <= #$303F)) or // Ideographic Description Characters / CJK Radicals Supplement
+ ((#$31C0 <= u) and (u <= #$31EF)) or // CJK Strokes
+ ((#$3200 <= u) and (u <= #$4DBF)) or // Enclosed CJK Letters and Months / CJK Compatibility / CJK Unified Ideographs Extension A
+ ((#$4E00 <= u) and (u <= #$9FFF)) or // CJK Unified Ideographs
+ ((#$F900 <= u) and (u <= #$FAFF)) or // CJK Compatibility Ideographs
+ ((#$FE30 <= u) and (u <= #$FE4F))) // CJK Compatibility Forms
then exit(THWFont( ord(font) + ((ord(High(THWFont))+1) div 2) ));
inc(i)
end;