[fpc-pascal] TStringHelper and Utf8String
Marco van de Voort
fpc at pascalprogramming.org
Sun Aug 30 21:02:32 CEST 2026
Op 30-8-2026 om 19:40 schreef Ondrej Pokorny via fpc-pascal:
>
> You don't need LazUTF8 anymore with recent FPC versions. FPC has
> everything built-in. (I don't like Lazarus dependencies in console
> applications.)
>
> Set these 3 CodePages to CP_UTF8:
> SetMultiByteConversionCodePage(CP_UTF8);
> SetMultiByteRTLFileSystemCodePage(CP_UTF8);
> SetMultiByteFileSystemCodePage(CP_UTF8);
>
> and you are good to go.
>
For a recent Windows 10 or 11 for a non lazarus program simply add
"winmanutf8lfn" to the uses line of the main program. This works in FPC
3.2.4-rc2 and trunk
For a lazarus compiled program (also console) simply enable the utf8 and
lfn ticks in the application manifest, which does the same as the unit,
but also works with 3.2.2.
The manifest changes make the whole winapi accept utf8, effectively
working as an native UTF-8 system, with as only downside win10+ (and
1805 or 1905+.
At the same time, the LFN tick (or the unit) enables support for file
paths > 260 characters.
More information about the fpc-pascal
mailing list