diff --git a/hslib.pas b/hslib.pas index bd1796a..c6b7ccc 100644 --- a/hslib.pas +++ b/hslib.pas @@ -385,28 +385,11 @@ begin if c then result:=a else result:=b end; function min(a,b:integer):integer; begin if a < b then result:=a else result:=b end; -// this table is to be used by ipos(), to be calculated once -var - upcaseTab: array [char] of char; function ipos(ss, s: string; ofs:integer=1):integer; overload; - - procedure initTab(); - var - i: char; - tmp: string; - begin - for i:=#0 to #255 do - begin - tmp:=ansiUppercase(i); - upcaseTab[i]:=tmp[1]; - end; - end; - var rss, rs, rss1, p: pchar; l: integer; begin -if upcaseTab[#1] = #0 then initTab(); result:=0; l:=length(s); if (l < ofs) or (l = 0) or (ss = '') then exit; @@ -418,7 +401,7 @@ for result:=ofs to l do begin rss:=rss1; p:=rs; - while (rss^ <> #0) and (rss^ = upcaseTab[p^]) do + while (rss^ <> #0) and (rss^ = upcase(p^)) do begin inc(rss); inc(p); diff --git a/main.pas b/main.pas index 7377efe..9615a68 100644 --- a/main.pas +++ b/main.pas @@ -1644,7 +1644,7 @@ this would let us have "=" inside the names, but names cannot be assigned comments:=THashedStringList.create(); try comments.caseSensitive:=FALSE; - try comments.loadFromFile(folder.resource+'\'+COMMENTS_FILE); + try comments.loadFromFile(folder.resource+'\'+COMMENTS_FILE, TEncoding.UTF8); except end; loadIon(folder.resource, comments); i:=if_((filesFilter='\') or (urlFilesFilter='\'), faDirectory, faAnyFile); @@ -2500,7 +2500,7 @@ try try try comments.CaseSensitive:=FALSE; - comments.LoadFromFile(resource+'\..\'+COMMENTS_FILE); + comments.LoadFromFile(resource+'\..\'+COMMENTS_FILE, TEncoding.UTF8); result:=comments.values[name]; except end finally @@ -4392,7 +4392,7 @@ var // comments file try fn:=lastPath+COMMENTS_FILE; - ss.loadFromFile(fn); + ss.loadFromFile(fn, TEncoding.UTF8); anyChange:=FALSE; for i:=trancheStart to trancheEnd do begin @@ -4405,7 +4405,7 @@ var if ss.count = 0 then deleteFile(fn) else - ss.saveToFile(fn); + ss.saveToFile(fn, TEncoding.UTF8); except end; // descript.ion if not mainfrm.supportDescriptionChk.checked then exit;