diff --git a/jnius/jnius_conversion.pxi b/jnius/jnius_conversion.pxi index 7c26199..78e7931 100644 --- a/jnius/jnius_conversion.pxi +++ b/jnius/jnius_conversion.pxi @@ -46,7 +46,7 @@ cdef void populate_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, ar elif isinstance(py_arg, basestring) and \ argtype in ('Ljava/lang/String;', 'Ljava/lang/Object;'): j_args[index].l = j_env[0].NewStringUTF( - j_env, py_arg) + j_env, py_arg.encode('utf-8')) elif isinstance(py_arg, JavaClass): jc = py_arg check_assignable_from(j_env, jc, argtype[1:-1]) diff --git a/tests/test_implementation.py b/tests/test_implementation.py index 5fd7d32..9237ac4 100644 --- a/tests/test_implementation.py +++ b/tests/test_implementation.py @@ -1,4 +1,4 @@ -# coding: utf-8 +# -*- coding: utf-8 -*- import unittest from jnius.reflect import autoclass @@ -18,4 +18,4 @@ class ImplementationTest(unittest.TestCase): def test_unicode(self): System = autoclass('java.lang.System') - System.out.printf('é'.encode('utf-8')) + System.out.printf(u'é')