Results 1 to 6 of 6

Thread: Codepage 437

  1. #1
    Join Date
    Oct 2008
    Location
    Catalunya
    Posts
    22
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Codepage 437

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Codepage 437

    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/ho...l/qatutils.cpp (Search for QCodePage437Codec)

    Lykurg

  3. The following 2 users say thank you to Lykurg for this useful post:

    josepvr (24th February 2009), talk2amulya (24th February 2009)

  4. #3
    Join Date
    Oct 2008
    Location
    Catalunya
    Posts
    22
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Codepage 437

    Thanks!!!

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


    Thank's a lot!

  5. #4
    Join Date
    Oct 2008
    Location
    Catalunya
    Posts
    22
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Codepage 437

    It worked for me!

    Thanks!

  6. #5
    Join Date
    Oct 2008
    Location
    Catalunya
    Posts
    22
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Codepage 437

    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!

  7. #6
    Join Date
    Oct 2008
    Location
    Catalunya
    Posts
    22
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Codepage 437

    Solved replacing Hex codes in:
    cp437FromUnicode[256] =
    {...}

    and

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


    Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.