Forum > Graphics

Canvas.Textout OEM codepage

(1/1)

Martin V:
I tried to get a canvas text output in OEM (IBM 437/850) codepage which is for example used in the Windows commandline window. There are some special characters (e.g. for line drawing) which are not part of the ANSI (Windows default 1252) codepage. If I use Canvas.Textout, a UTF8 string is expected. Can I directly print OEM/ANSI strings or/and is it possible to convert a OEM coded string to UTF8 ?

Martin

theo:
uses LConvEncoding;
...
var Astr:String;
begin
AStr:=#$C8#$C9#$CA;
Caption:=ConvertEncoding(AStr,'cp850',EncodingUTF8);
end;

Martin V:
Thank you, the code works fine. I can understand the decision that UTF8 is the default string format in Lazarus. It can handle the characters of all existing codepages. That's really great.

Martin

Navigation

[0] Message Index

Go to full version