[fpc-devel] FPC 2.3.1 seems a mixed mess with Unicode support

Graeme Geldenhuys graemeg at opensoft.homeip.net
Tue Sep 15 12:56:08 CEST 2009


Florian Klaempfl het geskryf:
> 
> You should have tested with the unicode string branch one year ago ;)

I gave up a long time ago testing "unstable" FPC branches with
production code. Things change to often. I only test with the new FPC
when it is announced that a new version ('fixes' branch is created) is
on its way.


> Who says that? What is not supported?

This I found myself:
* Unicode+Variants... varUString type.

By Google'ing for some D2009 unicode examples and searching the FPC
source. Here I list a few that I found in under 5 minutes:

http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:2894
* No TCharacter Class

http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:2879
* No CharInSet() function
* No IsSurrogate() function
* No IsSurrogatePair() function

http://www.bobswart.nl/Weblog/Blog.aspx?RootId=5:2874
* No ConvertFromUtf32() function

http://edn.embarcadero.com/article/38437
* As per Embarcadero example. I substituted String for UnicodeString.
Compile and run and I do not see the 世 character as mentioned in the
article.
-----------------------------
program test2;

{$mode objfpc}{$H+}
uses
  Classes, SysUtils;

var
  MyChar: Char;
  MyString: UnicodeString;
begin
  MyString := '世界您好';
  MyChar := MyString[1];
  writeln(MyChar);
end.
-----------------------------


So than was just in 5 minuets. I pretty confident, if I keep going I can
list a lot more. Hence I can't believe you think FPC supports Unicode
like Delphi 2009+ does.


> claims to support the UnicodeString type fully and it can be that bad
> because e.g. MSE is using it afaik.

MSE only uses the BMP, nothing above that. No support for surrogate
pairs. So at best MSE is only UCS-2 compliant and NOT Unicode compliant.
Don't confuse the two.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/




More information about the fpc-devel mailing list