By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,052 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,052 IT Pros & Developers. It's quick & easy.

add encoding to standard encodings works different in python 2.5?

P: n/a
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: py*********
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: General discussion list for the Python programming language
List-Unsubscribe: <>,
<mailto:py***************** ubscribe>
List-Archive: <>
List-Post: <mailto:py*********>
List-Help: <mailto:py***************** p>
List-Subscribe: <>,
<mailto:py***************** scribe>
Newsgroups: comp.lang.python
Message-ID: <*********@python. org>
Lines: 30
X-Trace: 1166794941 339 [::ffff:]:53104
X-Complaints-To: ab***
Xref: comp.lang.python:512429


I use an encoding that is not available in the std python-encodings, say
encoding 'flup';
under different circumstances a user might wish different version of
'flup': a strict one or a more relaxed encoding.
(yes I know, this is terrible, but this is how it is)

in python2.4, I managed this by:
made and (coping an encoding from
python std encodings; using a encoding/decoding map as in,
with changes in the mapping).
placed and in my 'main'-directory
(the dir from which the my-python-source starts)
at start of my python-source: add an alias for the encoding:
encodings.aliases.aliases['flup']='flup_relaxed' (if user wishes
relaxed encoding)
this works; the encoding 'flup' is recognized and used.

when testing with python 2.5, this does not work.
my questions are:
- should this work in 2.5?
- how can i get this to work in 2.5 (nice if it would work in both 2.4
and 2.5)

btw, I use ubuntu linux edgy, with both python 2.4 and 2.5 installed

thanks, Henk-Jan
Dec 22 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.