fix encoding issues in test_implementation.py

This commit is contained in:
Mathieu Virbel 2013-06-24 09:36:31 +02:00
parent 68165ed04b
commit 2c5a14dae2
2 changed files with 3 additions and 3 deletions

View File

@ -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, <char *><bytes>py_arg)
j_env, <char *><bytes>py_arg.encode('utf-8'))
elif isinstance(py_arg, JavaClass):
jc = py_arg
check_assignable_from(j_env, jc, argtype[1:-1])

View File

@ -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'é')