UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)

hi,

  as I could not post at developer  forums yet. I have to post here. I have translates some js to Chinese. and while I rebuild
them, throw a error.

  here is the error message. btw,all the file and database have been UTF-8. 

  Traceback (most recent call last):
  File “lib/wnf.py”, line 376, in <module>
    run()
  File “lib/wnf.py”, line 256, in run
    bundlejs.bundle(options.no_compress)
  File “lib/py/webnotes/utils/bundlejs.py”, line 171, in bundle
    bundle.make()
  File “lib/py/webnotes/utils/bundlejs.py”, line 115, in make
    self.concat(infiles, os.path.relpath(os.path.join(self.path, outfile), os.curdir))

  File “lib/py/webnotes/utils/bundlejs.py”, line 76, in concat
    jsm.minify(tmpin, tmpout)
  File “lib/py/webnotes/utils/minify.py”, line 237, in minify
    self._jsmin()
  File “lib/py/webnotes/utils/minify.py”, line 228, in _jsmin
    self._action(1)
  File “lib/py/webnotes/utils/minify.py”, line 154, in _action
    self.theA = self._get()
  File “lib/py/webnotes/utils/minify.py”, line 101, in _get
    if c >= ’ ’ or c == ‘\n’:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe6 in position 0: ordinal not in range(128)


   how to fix this? thanks.

Alex,

Seems like a unicode error in minify.py (which is a 3rd party utility to compress js files). We will have to look into it.

On another note, we have already done some work on this in the "dev" branch. The solution to translation is to create a generic "layer" so that the visible elements / messages can be translated in any language.

If you are keen to developing, I urge you to look at what we have already tried:


The trick is to extract all messages from the code and database and put them in a file. We have also made a system to directly translate all those messages using Google Translate API. Finally the messages have to be update before they are shown in the views.

- Rushabh



W: https://erpnext.com
T: @rushabh_mehta

On 11-Oct-2012, at 9:59 PM, Alex <yu...@gmail.com> wrote:

hi,
  as I could not post at developer  forums yet. I have to post here. I have translates some js to Chinese. and while I rebuild
them, throw a error.

  here is the error message. btw,all the file and database have been UTF-8. 

  Traceback (most recent call last):
  File "lib/wnf.py", line 376, in <module>
    run()
  File "lib/wnf.py", line 256, in run
    bundlejs.bundle(options.no_compress)
  File "lib/py/webnotes/utils/bundlejs.py", line 171, in bundle
    bundle.make()
  File "lib/py/webnotes/utils/bundlejs.py", line 115, in make
    self.concat(infiles, os.path.relpath(os.path.join(self.path, outfile), os.curdir))

  File “lib/py/webnotes/utils/bundlejs.py”, line 76, in concat
    jsm.minify(tmpin, tmpout)
  File “lib/py/webnotes/utils/minify.py”, line 237, in minify
    self._jsmin()
  File “lib/py/webnotes/utils/minify.py”, line 228, in _jsmin
    self._action(1)
  File “lib/py/webnotes/utils/minify.py”, line 154, in _action
    self.theA = self._get()
  File “lib/py/webnotes/utils/minify.py”, line 101, in _get
    if c >= ’ ’ or c == ‘\n’:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe6 in position 0: ordinal not in range(128)


   how to fix this? thanks.

Thanks,Rushabh.


it is nice for that, I would take a look about that.



2012/10/12 Rushabh Mehta <rm…@gmail.com>

Alex,

Seems like a unicode error in minify.py (which is a 3rd party utility to compress js files). We will have to look into it.


On another note, we have already done some work on this in the "dev" branch. The solution to translation is to create a generic "layer" so that the visible elements / messages can be translated in any language.


If you are keen to developing, I urge you to look at what we have already tried:



The trick is to extract all messages from the code and database and put them in a file. We have also made a system to directly translate all those messages using Google Translate API. Finally the messages have to be update before they are shown in the views.


  • Rushabh





On 11-Oct-2012, at 9:59 PM, Alex <yu...@gmail.com> wrote:

hi,
as I could not post at developer forums yet. I have to post here. I have translates some js to Chinese. and while I rebuild
them, throw a error.

here is the error message. btw,all the file and database have been UTF-8.

Traceback (most recent call last):
File "lib/wnf.py", line 376, in <module>
run()
File "lib/wnf.py", line 256, in run
bundlejs.bundle(options.no_compress)

File "lib/py/webnotes/utils/bundlejs.py", line 171, in bundle
bundle.make()
File "lib/py/webnotes/utils/bundlejs.py", line 115, in make
self.concat(infiles, os.path.relpath(os.path.join(self.path, outfile), os.curdir))

File "lib/py/webnotes/utils/bundlejs.py", line 76, in concat
jsm.minify(tmpin, tmpout)
File "lib/py/webnotes/utils/minify.py", line 237, in minify
self._jsmin()

File "lib/py/webnotes/utils/minify.py", line 228, in _jsmin
self._action(1)
File "lib/py/webnotes/utils/minify.py", line 154, in _action
self.theA = self._get()
File "lib/py/webnotes/utils/minify.py", line 101, in _get

if c &gt;= &#39; &#39; or c == &#39;\n&#39;:<br>UnicodeDecodeError: &#39;ascii&#39; codec can&#39;t decode byte 0xe6 in position 0: ordinal not in range(128)</blockquote><div><br></div><div>   how to fix this? thanks.</div>




--

Thanks & Regards