[fpc-devel] Russian locale information not compatible with FPC locale variables
Daniël Mantione
daniel.mantione at freepascal.org
Wed Jul 30 18:05:10 CEST 2008
Op Wed, 30 Jul 2008, schreef Graeme Geldenhuys:
> Does FPC have any any functions that work correctly with surrogate
> pair used by UTF-16?
Likely, because I doubt FPC has routines, other than UTF-8 <-> UTF-16
conversion, that need to bother with surrogate pairs. I.e. the following
code is fully correct in an UTF-16 environment:
procedure upcase(var s:widestring);
var i:longint;
begin
for i:=1 to length(s) do
s[i]:=upcase(s[i]);
end;
...because all characters that need upper/lower casing are in the BMP.
Likewise, all possible thousand separators are in the BMP, so you don't
need to bother with that either.
> If so, it would same me a lot of time implementing them myself. What
> would Pos, Length, Copy etc return?
This would be the same behaviour as with widestrings. RTL routines are
dump, smarter ones should go in sysutils.
Daniël
More information about the fpc-devel
mailing list