Hopefully this is the last error. Fix the if test, offset by -1 due to how the output appears to be handled.
authornemo
Thu, 07 Jan 2010 22:59:14 +0000
changeset 2684 04c086d8d9d4
parent 2683 bad2a30d5d6c
child 2685 0ba746be5d59
Hopefully this is the last error. Fix the if test, offset by -1 due to how the output appears to be handled.
hedgewars/uStore.pas
--- 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;