-
too much russian comments in kol&mck source, will raise exception during delphi compiling, i think use english much better.
SmartOem2CharRus() is special, i think it maybe remove from kol.pas. it can't be compiled in other language windows platform except russia.
-
kol is a common liberary for all of world, it's better not include any special region code or comments.
-
Can you give me a line where it fails? We are doing this more than 10 years and it should not be a problem.
-
> use english much better
Нет.
> remove from kol.pas
Нет.
> for all of world
От жеж загнул, иноземец. Ну напиши разработчикам чтоб расширили SmartOem2Char* на все языки)) Удачи)))
-
function WndProc_LVSubitemDraw()
begin
...
Rslt := CDRF_DODEFAULT // rusian comment
...
Rslt := CDRF_NEWFONT; // rusian comment
...
end;
function smartOem2ansiRus(const s: AnsiString): AnsiString;
function good(const x, y: AnsiString): Boolean;
begin
...
if x[i] in ['?..'', '?..'? {, '?, '?}] then // delphi xe2 can't compile
continue;
...
end
begin
end;
-
function smartOem2ansiRus sugggest move to a special unit like 'KOL_RUS.pas'
-
Тогда уж типа kol_i18n.pas
-
We can also compromise and write everything in Dutch ;)
Kol is written by a Russian. Lot's more people know Russian than Dutch.....
And most comments are both in Russian and in English. Why not Dutch? That's the same as Russian for most English speakers anyway ;)
We have a saying in the Netherlands:
"It's all Chinese to me..."
-
a fixed version to support other language
-----------------------------------------
function smartOem2ansiRus(const s: AnsiString): AnsiString;
function good(const x, y: AnsiString): Boolean;
var i: Integer;
begin
Result := FALSE;
if Length(x) <> Length(y) then Exit;
for i := 1 to Length(x) do
begin
if x[i] = y[i] then continue;
if x[i] in [ #$E0..#$FF, #$C0..#$DF {, #$B8, #$A8}] then
continue;
Exit;
end;
Result := TRUE;
end;
begin
Result := oem2char(s);
if good(Result, s) then Exit;
Result := ansi2oem(s);
if good(Result, s) then Exit;
Result := s;
end;
-
a fixed version to support other language
-----------------------------------------
function smartOem2ansiRus(const s: AnsiString): AnsiString;
function good(const x, y: AnsiString): Boolean;
var i: Integer;
begin
Result := FALSE;
if Length(x) <> Length(y) then Exit;
for i := 1 to Length(x) do
begin
if x[i] = y[i] then continue;
if x[i] in [ #$E0..#$FF, #$C0..#$DF {, #$B8, #$A8}] then
continue;
Exit;
end;
Result := TRUE;
end;
begin
Result := oem2char(s);
if good(Result, s) then Exit;
Result := ansi2oem(s);
if good(Result, s) then Exit;
Result := s;
end;
-
Well, frankly, that won't do... In some cases.
But if you use a recent version of Freepascal this can be done by providing the code page and the translations are done automagically. The issue is more complex than that. Also, note that KOL itself already has some Koi/Ansi/Ascii routines somewhere.