[fpc-pascal] cwstrings unit and UTF8Decode()

Bart bartjunk64 at gmail.com
Fri Mar 25 18:14:15 CET 2016

On 3/25/16, Felipe Monteiro de Carvalho
<felipemonteiro.carvalho at gmail.com> wrote:

> Important part you are forgetting: {$IFDEF UTF8_RTL}
> I don't know why it is needed in the utf-8 RTL, since I haven't used
> this RTL yet, but in the RTL that I am using it doesn't depend in that
> unit :)

It's just a define to signal that all strings in LCL are UTF8 and when
offered to RTL their codepage is CP_UTF8.
Whe DisableUtf8RTL is defined than all strings are CP_ACP.

The name of the define may indeed be a little misleading, but it's short.
We have to cater for 3 different situations:
- default: we set DefaultSystemCodepage to CP_UTF8 (on Windows): UTF8_RTL
- DisableUtf8RTL defined: ACP_RTL
- Fpc without cp-string: NO_CP_RTL
(See ($lazarus)\components\lazutils\lazutils_defines.inc)


More information about the fpc-pascal mailing list