[Lazarus] DOS charset to UTF-8

shoKwave shokwave at gmx.net
Mon Oct 19 18:18:26 CEST 2009


Mattias Gärtner schrieb:
> Zitat von Graeme Geldenhuys <graemeg.lists at gmail.com>:
>
>> On 19/10/2009, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
>>> Hi,
>>>
>>>  How to I convert a file that contains text in the DOS charset to
>>>  UTF-8. I need this to work under Linux and Windows.
>>>
>>>  The DOS charset characters used, are for box drawing and arrows. They
>>>  currently appear on my system (Linux) as follows:
>>>
>>>      ÄÄÄstatementÄÄÄÄÄÄÄ
>>
>>
>> I found the relevant character mapping tables at the Unicode website -
>> mapping from DOS codepage to unicode characters. The one I am
>> interested in is CP437 to Unicode.
>>
>> http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/
>>
>>
>> Is such mappings already implemented in Lazarus somewhere?
>
> I added it to lcl/lconvencoding.pas.
> This is also used by the IDE context menu.
>
>
> Mattias
>
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Just a little correction. The comment of the function says:
function CP437ToUTF8(const s: string): string;  // DOS central europe

According to the page 
http://msdn.microsoft.com/de-de/goglobal/bb964655%28en-us%29.aspx it 
should be: //DOS US

Ingo




More information about the Lazarus mailing list