[Lazarus] TMemo question

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Thu Dec 23 10:31:57 CET 2010


Hello,

You changed the subject of the thread and now gmail shows your last
message as the first one in a new thread, so I don't know what you are
talking about exactly. Ok, now I remembered it is about the special
font issue, but please don't change the subject field.

On Wed, Dec 22, 2010 at 10:10 AM, tim launchbury
<tim at tlaunchbury.ukfsn.org> wrote:
> I am still puzzled though, because when I was using fpgui, all I needed
> to do was convert the ansistring to display with the fpgmemo was
> convert it with ansitoutf8. This does not appear to work with the
> Lazarus TMemo.

Converting from ansi to utf8 is completely wrong in this case. Do you
know that the definition of ansi changes from computer to computer
resulting in a different end result if you do the conversion in a
russian, chinese, or european computer? Your code simply won't work
everywhere in the world.

Maybe, by coincidence, the ISO Latin 1 to UTF-8 conversion could be
used. You could try that. There is a conversion function
ISO85591ToUTF8 or something similar located in lconvencoding.pas in
the LCL.

In general, take a look in the Unicode characters table:

http://en.wikibooks.org/wiki/Unicode/Character_reference/0000-0FFF

I am not 100% sure if the 80 to FF characters correspond to Latin 1.
If you are converting from Latin 1 to UTF-8 then the conversion will
only work if they do correspond.

> SHould the lcl utf8 conversions work on an ansistring, or will I need
> to write my own routine?

Try converting from Latin 1 to UTF-8 and if it doesn't work write your
own routine.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list