I am having an inordinate amount of difficulties locating an example of how to display Unicode using Lazarus and FPC. It's supposed to be fully UTF-8 capable now, yet all I get are question marks for text strings, or else little skinny boxes in place of the characters.
Can someone provide for me a very simple example of how to make this work?
Version #: 0.9.26.2 beta
FPC Version 2.2.2
SVN Revision: 18980
I'm running this test on Windows XP Media Center Edition.
Is there an environment variable that must be set (LANG?) to make this work? If so, what must it be set to?
Every example I have found online has not worked, or else it left out some key piece of information required to make it work. In fact, I have not found any complete working example, just little snippets of code that don't seem relevant to my situation.
I've tried various fonts including Lucida Sans Unicode and Arial Unicode MS, and just about every other one on my system. Tahoma was mentioned in one example but it didn't work any better.
I've tried using a Label control, an Edit control, and a SynEdit control. I use TRichEdit in the Delphi version of my program, and SynEdit is the closest equivalent control in Lazarus.
I notice that Lazarus/FPC provides routines to convert from AnsiToUTF8, UTF8ToAnsi, also SysToUTF8 and UTF8ToSys.
But I am puzzled by the fact there are no routines provided to convert between the WideString form of a Unicode string and the UTF8 representation. That's very odd to me. It would seem that such routines would be provided for convenience.
Is there some piece of the puzzle that I am missing?
Can someone give me a clue or a code snippet to demonstrate EXACTLY how to display something like Cyrillic or Greek? I'd be very happy to know the secret of how it's supposed to work.
Thanks in advance for any help you can provide.