jython 'utf8 encoding not found error

Radosław Madej <[email protected]>
Newsgroups gmane.comp.lang.jython.user
Message-ID <AMSPR05MB437644774EF127A621E3794993A0@AMSPR05MB437.eurprd05.prod.outlook.com>
Hi,

I have a problem with jython 'utf8' encoding.

The Jython version I am using is 2.5.3, embedded in my web application. After doing this in my Java code:

PythonInterpreter pythonInterpreter = new PythonInterpreter();

pythonInterpreter.exec("import codecs");

pythonInterpreter.exec("codecs.getreader('utf8')");

Such an error occurs:

File "<string>", line 1, in <module>

File "__pyclasspath__/codecs$py.class", line 920, in getreader

LookupError: no codec search functions registered: can't find encoding 'utf8'

How can the reader with 'utf8' encoding be obtained properly?

According to the python documentation, there should be 'utf8' encoding available in codecs module: https://docs.python.org/2/library/codecs.html#standard-encodings (lower / upper case and hyphen / underscore are all allowed).

I use Windows 7, java 1.7.0_71. OS should not matter I guess - this is the web application run on jboss (version 7.2).

I've also posted the question to the stackoverflow, but no answers yet...:

http://stackoverflow.com/questions/28303395/how-to-obtain-utf-8-reader-in-pythoninterpreter-jython

Br,

Radek

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.