[Lazarus] TProcess, UTF8, Windows

Marco van de Voort marcov at stack.nl
Sun Apr 15 15:11:24 CEST 2012


On Sun, Apr 15, 2012 at 12:35:08PM +0200, Mattias Gaertner wrote:
> I'm not sure what you mean with "the Lazarus UTF8String". 
> 
> There is UTF8String = type AnsiString(CP_UTF8) defined in system.pp.
> 
> Under Linux and OS X any LCL application gets
> DefaultSystemCodePage:=CP_UTF8, so all strings without an encoding are
> treated as CP_UTF8, which means encoded as UTF8String.

Under OSes that have UTF-8 as default 1 byte encoding, CP_ACP should behave
as if it were UTF-8.

The whole idea is that you mark the outside world with CP_ACP, and your own
internal encoding UTF-8. (or unicodestring, the principle doesn't depend on
that), and the RTL makes the conversion from ACP to UTF8 automatically.
 
So manually setting CP_UTF8 as system encoding is a workaround, not a long
term solution.




More information about the Lazarus mailing list