Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-10

DOS charset to UTF-8

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

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???????

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 9 lines
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?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys

Zitat von Graeme Geldenhuys :

Show quoted text 20 lines
On 19/10/2009, Graeme Geldenhuys 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

Reply by email

shoKwave
to Mattias Gärtner: Zitat von Graeme Geldenhuys : I added it to lcl/lconvencoding.pas. This is also used by…
Show quoted text 35 lines
Zitat von Graeme Geldenhuys : > On 19/10/2009, Graeme Geldenhuys 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 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

Reply by email

Graeme Geldenhuys
to Mattias Gärtner: Zitat von Graeme Geldenhuys : I added it to lcl/lconvencoding.pas. This is also used by…

2009/10/19 Mattias G?rtner :

Show quoted text 5 lines
> > Is such mappings already implemented in Lazarus somewhere? I added it to lcl/lconvencoding.pas. This is also used by the IDE context menu.

Out of interest. Did you manually code the mapping, or is there a tool that you run to generate the Pascal code from the cp437.txt file?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email