On Creating Codecs

Y

Your Name

Hi,
I have been trying to generate codecs for my language in Python using
gencodec.py.
The problem is the codec created does not work.
Here is the process that I followed.
I created a directory inside [python_installation]/tools/scripts and
put in a text file containing the mapping.
Here is a sample from it.
0x63 0x0915 # acsii letter c
0x64 0x0916
0x65 0x0917 # ascii letter e
0x66 0x0918
0x67 0x0919
As my Language was not standardized before Unicode, I have to use
fonts that have been developed using the ascii character set.
Now in the table I map ascii representative values to the char
encoding in Unicode.
Now using gencodec.py I generate the codecs. It gives me a py script
file, which I placed in the [python_installation]/lib/encodings
directory.
Now I try to use the codec from the shell and below is my session on
it.
Traceback (most recent call last):
File "<pyshell#1>", line 1, in ?
string.encode('nepali')
File "C:\Python22\lib\encodings\nepali.py", line 18, in encode
return codecs.charmap_encode(input,errors,encoding_map)

I may be doing something wrong. Can you please tell me how to go about
it. I am using Python 2.2 on Windows XP.
Thank you.

PRJoshi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top