[fpc-pascal] How to get programatically a UTF8 encoded string?

Luiz Americo Pereira Camara luizmed at oi.com.br
Tue Jul 21 21:33:20 CEST 2009


I tried to get UTF8 encoded strings programatically by doing
 
    Key := UTF8Encode('ç');
    Str := UTF8Encode('Ç');

but when i test the code below it will fail, unlike when using know UTF8 
encoded strings

    if WideCompareText(UTF8Decode(Key), UTF8Decode(Str)) = 0 then
      WriteLn('  WideCompareText OK');                         

Any hint on how to get UTF8 encoded strings at runtime?

Luiz



More information about the fpc-pascal mailing list