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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to