UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position 11908: ordinal not in range(128)

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

Command

!j2py a.java p.py

where a.java is an input java file.

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)


Read more here: https://stackoverflow.com/questions/66992601/unicodedecodeerror-ascii-codec-cant-decode-byte-0xef-in-position-11908-ordi

Content Attribution

This content was originally published by Shivani at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: