← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 718651] [NEW] importing a translation with arabic characters fails

 

On Monday 14 February 2011, you wrote:
> Public bug reported:
> 
> if i export a translation file for all modules, make my changes
> according to the desired language which is arabic in this case, and try
> to reimport it, i get an encoding error.
>
> DataError: invalid byte sequence for encoding "UTF8": 0xc3cd
> HINT:  This error can also happen if the byte sequence does not match the
> encoding expected by the server, which is controlled by "client_encoding".

It sounds a little strange to me, I thought we have solved all unicode issues 
in the framework.

Can you please open the po file with an editor (preferrably a text editor like 
kwrite or gedit) and verify that the arabi strings are intact (not truncated, 
or no error message from the text editor) ?

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/718651

Title:
  importing a translation with arabic characters fails

Status in OpenERP Server:
  New

Bug description:
  if i export a translation file for all modules, make my changes
  according to the desired language which is arabic in this case, and
  try to reimport it, i get an encoding error.

  Traceback (most recent call last):
    File "/usr/lib/python2.6/site-packages/openerp-server/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/openerp-server/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/lib/python2.6/site-packages/openerp-server/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/usr/lib/python2.6/site-packages/openerp-server/addons/base/module/wizard/base_import_language.py", line 59, in import_lang
      tools.trans_load_data(cr, fileobj, fileformat, import_data.code, lang_name=import_data.name)
    File "/usr/lib/python2.6/site-packages/openerp-server/tools/translate.py", line 932, in trans_load_data
      trans_obj.create(cr, uid, dic)
    File "/usr/lib/python2.6/site-packages/openerp-server/addons/base/ir/ir_translation.py", line 184, in create
      ids = super(ir_translation, self).create(cursor, user, vals, context=context)
    File "/usr/lib/python2.6/site-packages/openerp-server/osv/orm.py", line 3605, in create
      cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
    File "/usr/lib/python2.6/site-packages/openerp-server/sql_db.py", line 78, in wrapper
      return f(self, *args, **kwargs)
    File "/usr/lib/python2.6/site-packages/openerp-server/sql_db.py", line 131, in execute
      res = self._obj.execute(query, params)
  DataError: invalid byte sequence for encoding "UTF8": 0xc3cd
  HINT:  This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

  the db's encoding is utf-8. if i reimport it without using any arabic
  characters, it works fine.





References