PDA

View Full Version : Codepage 437



josepvr
24th February 2009, 18:06
Hi!
I need to read some files saved in a old DOS machine, my problem is the encoding of this files is Codepage 437 and some characters are not displayed well.

I've read the QTextCodec documentation but the CP437 encoding is no supported.

Can somebody help me?

Thanks!

Lykurg
24th February 2009, 19:05
Hi

1. If you have access to the files, the best thing would be to convert them via a tool to utf8 and use these files with Qt.

2. Write your own QTextCodec class. Have for example a look at http://svn.openmoko.org/trunk/src/host/qemu-neo1973/phonesim/lib/serial/qatutils.cpp (Search for QCodePage437Codec)

Lykurg

josepvr
24th February 2009, 20:40
Thanks!!!

It's all I need. I'll try it tomorow.


Thank's a lot!

josepvr
25th February 2009, 15:16
It worked for me!

Thanks!

josepvr
1st March 2009, 21:56
Hi!

I've a problem with CP437 codec from qatutils.cpp in capital letters like ÀÁÈ.... are not readed/writed correcly.

How can I fix It?

Thanks!

josepvr
2nd March 2009, 14:52
Solved replacing Hex codes in:
cp437FromUnicode[256] =
{...}

and

static ushort const cp437ToUnicode[256] =
{....}


Thanks!