[twsocket] HttpServer UTF8 problem

2011-01-09 Thread Busai Péter
Hi!

I'm trying to port my webapplication to Delphi XE unicode compiler.
I have problem to encode accented text in RowDataGetter.
In recent nonunicode version I just made conversion like:
Tagdata.Add('key', AnsiToUTF8(some_accented_value))
In Delphi XE I tried Tagdata.Add('key',
UTF8Encode(some_accented_value)), but the result is not UTF8 encoded.
I think it is converted back to Unicode because Add accepts String
parameters.
Where and how should I do the conversion?

Thanks
Peter

A(z) kimenő üzenetben nem található vírus.
Ellenőrizte: AVG - www.avg.com
Verzió: 9.0.872 / Vírus adatbázis: 271.1.1/3368 - Kiadás dátuma: 01/08/11 
20:34:00
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Re: [twsocket] HttpServer UTF8 problem

2011-01-09 Thread Arno Garrels
Busai Péter wrote:
 Hi!
 
 I'm trying to port my webapplication to Delphi XE unicode compiler.
 I have problem to encode accented text in RowDataGetter.
 In recent nonunicode version I just made conversion like:
 Tagdata.Add('key', AnsiToUTF8(some_accented_value))
 In Delphi XE I tried Tagdata.Add('key',
 UTF8Encode(some_accented_value)), but the result is not UTF8 encoded.
 I think it is converted back to Unicode because Add accepts String
 parameters.

Yes, TStringIndex stores strings in a TStringList. 

 Where and how should I do the conversion?

Unless some utility functions are not changed to support  more than system's
ANSI codepage it's not possible. These functions could get overloaded versions
that take a CodePage argument.

-- 
Arno Garrels
 

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be