static int compareStringsUnicode(const char** in1, const char** in2) {
    int result = compareStringsUnicodeFast(in1, in2);
    if (result > -2)
        return result;

    // Fast compare failed, so resort to using java.text.Collator
    // HACK : calling back to Java to do unicode string compare.
    const char* str1 = createStringFromJSON(in1);
	const char* str2 = createStringFromJSON(in2);
	return uca_string_compare(str1, str2);
}
static int compareStringsUnicode(const char** in1, const char** in2) {
    int result = compareStringsUnicodeFast(in1, in2);
    if (result > -2)
        return result;
    // Fast compare failed, so resort to using NSString:
    jstring str1 = createJavaStringFromJSON(in1);
    jstring str2 = createJavaStringFromJSON(in2);
    JNIEnv *env = getEnv();
    result = env->CallStaticIntMethod(collatorClass, compareMethod, str1, str2);
    env->DeleteLocalRef(str1);
    env->DeleteLocalRef(str2);
    return result;
}