diff --git a/jnius/jnius_conversion.pxi b/jnius/jnius_conversion.pxi index 3e966d4..7c26199 100644 --- a/jnius/jnius_conversion.pxi +++ b/jnius/jnius_conversion.pxi @@ -76,13 +76,18 @@ cdef void populate_args(JNIEnv *j_env, tuple definition_args, jvalue *j_args, ar elif argtype[0] == '[': if py_arg is None: j_args[index].l = NULL - else: - if not isinstance(py_arg, list) and \ - not isinstance(py_arg, tuple): - raise JavaException('Expecting a python list/tuple, got ' - '{0!r}'.format(py_arg)) - j_args[index].l = convert_pyarray_to_java( - j_env, argtype[1:], py_arg) + continue + if isinstance(py_arg, basestring): + if argtype == '[B': + py_arg = map(ord, py_arg) + elif argtype == '[C': + py_arg = list(py_arg) + if not isinstance(py_arg, list) and \ + not isinstance(py_arg, tuple): + raise JavaException('Expecting a python list/tuple, got ' + '{0!r}'.format(py_arg)) + j_args[index].l = convert_pyarray_to_java( + j_env, argtype[1:], py_arg) cdef convert_jobject_to_python(JNIEnv *j_env, bytes definition, jobject j_object): diff --git a/jnius/jnius_utils.pxi b/jnius/jnius_utils.pxi index ebb1f56..7d893b4 100644 --- a/jnius/jnius_utils.pxi +++ b/jnius/jnius_utils.pxi @@ -198,7 +198,12 @@ cdef int calculate_score(sign_args, args, is_varargs=False) except *: if r[0] == '[': if arg is None: - return 10 + score += 10 + continue + + if (r == '[B' or r == '[C') and isinstance(arg, basestring): + score += 10 + continue if not isinstance(arg, tuple) and not isinstance(arg, list): return -1