I have this code in the Google AppEngine (Python SDK):
from string import maketrans
intab = u"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ".encode('latin1')
outtab = u"aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn".encode('latin1')
logging.info(len(intab))
logging.info(len(outtab))
trantab = maketrans(intab, outtab)
When I run the code in the interactive console, I have no problem, but when I try to use it in GAE, I get the following error:
raise ValueError, "maketrans arguments should have the same length" ValueError: maketrans arguments should have the same length INFO 2009-12-03 20: 04: 02,904 dev_appserver.py:3038] "POST / backendsavenew HTTP / 1.1" 500 - INFO 2009-12 -03 20: 08: 37,649 admin.py:112] 106 INFO 2009-12-03 20: 08: 37,651 admin.py:113] 53 ERROR 2009-12-03 20: 08: 37,653 init .py: 388] arguments maketrans must be the same length
, intab .
python UTF-8.
.