Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4: ordinal not in range(128) #25

Open
macagua opened this issue May 25, 2013 · 1 comment
Labels

Comments

@macagua
Copy link
Member

macagua commented May 25, 2013

Hi @vangheem

I am using i18ndude for extract the i18n strings using a bash script and when executes show the bellow error:

(i18ndude)macagua@dacagua:~/proyectos/plone/git/collective.documentviewer/collective/documentviewer/locales$ ./rebuild_i18n.sh 
There was an error processing ../templates/documentviewer.pt
Traceback (most recent call last):
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/i18ndude/extract.py", line 500, in tal_strings
    metal=False)()
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 266, in __call__
    self.interpret(self.program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 860, in do_useMacro
    self.interpret(block)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 907, in do_fillSlot
    self.interpret(block)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 853, in do_defineMacro
    self.interpret(macro)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 513, in do_optTag
    return self.no_tag(start, program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 508, in no_tag
    self.interpret(program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 847, in do_condition
    self.interpret(block)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 513, in do_optTag
    return self.no_tag(start, program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 508, in no_tag
    self.interpret(program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 847, in do_condition
    self.interpret(block)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 513, in do_optTag
    return self.no_tag(start, program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 508, in no_tag
    self.interpret(program)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 338, in interpret
    handlers[opcode](self, args)
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 711, in do_insertTranslation
    default = tmpstream.getvalue()
  File "/home/macagua/virtualenv/i18ndude/lib/python2.6/site-packages/zope/tal/talinterpreter.py", line 1007, in getvalue
    return u''.join(self)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4: ordinal not in range(128)

I am trying to remplace all special characters with ASCII codes into documentviewer.pt file is included in three times the bellow line:

<span class="required" i18n:attributes="title" title="Required" style="color: #f00;">■</span>

What kind of special character are you want represent?

@gbastien
Copy link
Member

Hi @macagua ,

just note that existing msgids are already in the collective.document.pot file at https://github.com/collective/collective.documentviewer/tree/master/collective/documentviewer/locales but I agree that using i18ndude to generate the pot could ease translations management...

Gauthier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants