[fpc-pascal] FPC Unicode / CodePage aware strings

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Dec 10 11:54:02 CET 2015

On 2015-12-10 10:29, Jonas Maebe wrote:
> The language feature is implemented in a Delphi 2009-compatible way  
> (although some Delphi-specific behaviour is only activated in {$mode  
> delphiunicode}).

Okay, so forget Delphi 2009 compatibility for the moment (I don't use
Delphi). So does this mean to use "official" FPC Unicode, I can't use
{$mode objfpc} any more?

> Not all RTL (let alone Lazarus, like for TMemo)  
> support is ready yet.

No problem, I changed the example to a console program and used
WriteLn() instead.

Does WriteLn() work correctly with Unicode text? Will it detect my
console encoding used in mate-terminal or xterm under FreeBSD? If not,
what else must I do to test this Unicode support?

>> So already it seems information is missing for FPC usage,
> It's all documented on the wiki page you mention below.

As past experience has shown me, the wiki is a very unreliable source -
often things are way out of date, or "concepts" was documented but never
removed when something else was decided etc.

But I'll spend my lunch time reading the wiki page in question and see
if anything helps. But like I said, the experience thus far is anything
but ideal or straight forward.

> It is the "white paper [or] blog post" you were asking about.

Both. I can't follow the examples shown in the Delphi_and_Unicode.pdf,
because they simply don't compiler or don't run.

The wiki pages doesn't have a single compilable "test program" example
that can get you going.

Here is the Lazarus Forum discussion on FPC's new String support in 3.0.
I tried that example on my FreeBSD system too, and the console output
was total rubbish no matter what I tried.


  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

My public PGP key:  http://tinyurl.com/graeme-pgp

More information about the fpc-pascal mailing list