May be should look at the option "java -Dfile.encoding=" or add a coding mark in your Python file like "# -*- coding: iso-8859-15 -*-". I hope it helps.

2010/12/23 Edgar Merino <donvodka@gmail.com>
Hello:

    I'm trying to use a script that's inside a JAR file, in a directory
hierarchy like the following:

|- myJAR.jar
    |- package
    |- __init__.py
        |- script.py

    The python script contains a class that references a simple custom
Java class (from java.classes import MyJavaClass). So, what I do is this:

File jarFile = new File("/path/to/file.jar");
PySystemState pySys = new PySystemState();
pySys.path.insert(0, new PyString(jarFile.getPath()));

PythonInterpreter interpreter = new PythonInterpreter(null, pySys);
interpreter.exec("from package.script import PythonClass");


    But when I run this code, I get an exception:

"UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in
position 24: ordinal not in range(128)."

    This happens only when I try to load the script from the jar file,
if I do it from the filesystem it'll load without a problem and
everything will run just fine. I'm using Jython 2.5.2rc2.


Any help would be greatly appreciated, thanks in advance!
Edgar Merino


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users



--
A+

-------------
Pierre