* fixed the conversion of 'UTF-8' to the corresponding code page number

(there's a dummy entry with code page 0 for UTF-8 in the table for
     when 0 is searched, but when going from string to number that
     entry has to be skipped so the real UTF-8 entry is used)

git-svn-id: trunk@22245 -
This commit is contained in:
Jonas Maebe 2012-08-26 08:58:42 +00:00
parent 17c495595c
commit d4eb2d7336

View File

@ -655,8 +655,10 @@ begin
SetCodePage(cpname,$ffff,false);
{ simple linear scan, not a common operation and hence not worth
building a separate array for }
for i:=low(win2iconv_arr) to high(win2iconv_arr) do
building a separate array for -- start from index 1 rather than
0, because 0 = fake "code page 0" that maps to UTF-8 as default
}
for i:=low(win2iconv_arr)+1 to high(win2iconv_arr) do
if win2iconv_arr[i].name=cpname then
begin
result:=win2iconv_arr[i].cp;