Closed GoogleCodeExporter closed 9 years ago
p.s. Python 2.7.2
Original comment by pastr...@gmail.com
on 7 Mar 2012 at 2:12
The code has problems. In Python 2.x unicode strings are prefixed with u.
Change the script to
wordDic = \
{
'_':u' ',
'=2C':u',',
'=3D':u'=',
'=5B':u'[',
'=5D':u']',
'=7E':u'~',
'=C0':u'À', '=C1':u'Á', '=C2':u'Â', '=C3':u'Ã',
'=E0':u'à', '=E1':u'á', '=E2':u'â', '=E3':u'ã',
'=C7':u'Ç',
'=E7':u'ç',
'=C9':u'É', '=CA':u'Ê',
'=E9':u'é', '=EA':u'ê',
'=CD':u'Í', '=ED':u'í',
'=D3':u'Ó', '=D4':u'Ô', '=D5':u'Õ',
'=F3':u'ó', '=F4':u'ô', '=F5':u'õ',
'=DA':u'Ú',
'=FA':u'ú'
}
Further below:
out1 = multipleReplace(out0.decode(), wordDic)
and then the code should work as expected.
Please see PyScripter help topic "Encoded Python Source Files"
Original comment by pyscripter
on 7 Mar 2012 at 2:39
Thank you very much.
Your dedication (expressed by the prompt response and detailed directions)
is appreciated.
As you may have noted, it was my very first code in Python: I was testing
different approaches with regex.
Will dig further on Unicode issues.
Original comment by pastr...@gmail.com
on 7 Mar 2012 at 6:22
Original issue reported on code.google.com by
pastr...@gmail.com
on 7 Mar 2012 at 1:53Attachments: