natural / java2python

Simple but effective library to translate Java source code to Python.
GNU Lesser General Public License v2.1
564 stars 243 forks source link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 11908: ordinal not in range(128) #74

Closed shine-n-rize closed 3 years ago

shine-n-rize commented 3 years ago

After successful installation of java2python on google colab (python2), I am getting this error for the following command:

Command

!j2py a.java p.py

Error

# ERROR runTransform: exception while parsing
Traceback (most recent call last):
  File "/usr/local/bin/j2py", line 120, in runTransform
    tree = buildAST(source)
  File "/usr/local/lib/python2.7/dist-packages/java2python/compiler/__init__.py", line 15, in buildAST
    lexer = Lexer(StringStream(source))
  File "/usr/local/lib/python2.7/dist-packages/antlr_python_runtime-3.1.3-py2.7.egg/antlr3/streams.py", line 336, in __init__
    self.strdata = unicode(data)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 11908: ordinal not in range(128)
shine-n-rize commented 3 years ago

Just got rid of 'non-ascii' characters!