Unicode error handler

R

Rares Vernica

Hi,

Does anyone know of any Unicode encode/decode error handler that does a
better replace job than the default replace error handler?

For example I have an iso-8859-1 string that has an 'e' with an accent
(you know, the French 'e's). When I use s.encode('ascii', 'replace') the
'e' will be replaced with '?'. I would prefer to be replaced with an 'e'
even if I know it is not 100% correct.

If only this letter would be the problem I would do it manually, but
there is an entire set of letters that need to be replaced with their
closest ascii letter.

Is there an encode/decode error handler that can replace all the
not-ascii letters from iso-8859-1 with their closest ascii letter?

Thanks a lot,
Ray
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top