[Tutor] Help! Character conversion from a rtf file.

wesley chun wescpy at gmail.com
Fri Jun 20 21:40:56 CEST 2008


> I'd like to learn the language by writing some simple programs rather than
> keep reading books. My first program will convert certain uni-code characters
> (let's say UTF-8) in an RTF file format based on a certain mapping
> in another RTF file that is called a "RTF Control file".
>     :
> The program will write to a new file that contains a new set of mapped characters.
> If a character form the original file is not found in the Control file, then the program
> just write the same character to the new file.


hi chien,

and welcome to Python!  the Tutor list is here to help with any
learning questions you may have, but keep in mind that we cannot help
you with providing solutions to what we feel are education, high
school, college, or university course homework assignments, which is
what your problem sounds like.

the best advice i have for you at this time is to read in the
translation mapping into a Python dictionary, and then perform a
byte-to-byte traversal and conversion from the source file to the
destination file.

best of luck on your project!
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list