[fpc-devel] Unicode and Lazarus

Florian Klaempfl florian at freepascal.org
Fri Nov 21 10:49:35 CET 2008


Felipe Monteiro de Carvalho schrieb:
> On Fri, Nov 21, 2008 at 7:30 AM, Florian Klaempfl
> <florian at freepascal.org> wrote:
>> This is easily said, please create examples and descriptions how fully
>> working is defined.
> 
> // Should actually convert from widestring to utf-8 when using encoding utf-8
> programa utf8test1;
> 
> {$encoding utf-8} // or is it utf8?
> 
> var
>   Str: UTF8String;
> begin
>   Str := "ção";
>   if Length(Str) = 5 then Success
>   else Fail;
> end;
> 
> // Should work on all platforms. Passing the UTF8String to a routine
> that requires
> // ansistring should do the proper conversion
> programa utf8test2;
> 
> {$encoding utf-8} // or is it utf8?
> 
> var
>   Str: UTF8String;
> begin
>   Str := "ção";
>   WriteLn(Str);
> end;
> 

Big deal, I simply enable operator overloading for unique string types
to get this working, then everybody is happy and we've unicode support?



More information about the fpc-devel mailing list