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

Graeme Geldenhuys graemeg at opensoft.homeip.net
Tue Sep 15 13:53:09 CEST 2009


Florian Klaempfl het geskryf:
> 
> Do you use the cwstrings unit? Did you tell the encoding (UTF-8?) to the
> compiler? Did you use the UnicodeChar instead of Char?


Yes to all, and the example still doesn't work.

------------------------
$ ./test3
ä
------------------------

ä  is not 世 as the website described the result to be.

----------------------------
program test3;

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

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


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