Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Remote Config with Chinese characters

Remote Config getString() return different result between version 18.0.0 and version 19.0.0.

I have tried setting

org.gradle.jvmargs=-Dfile.encoding=UTF-8
systemProp.file.encoding=utf-8

in the gradle.properties

I also tried setting

compileOptions {
    encoding = 'UTF-8'
}

in build.gradle

below is the code snippet

fun getRemoteString(key: String) {
    val wording = FirebaseRemoteConfig.getInstance().getString(key) 
    Log.d(javaClass.simpleName, "wording= $wording")
    return wording
}

I expected Firebase Remote Config return 登入閱讀, just like what 18.0.0 returned but now it returns ç»å¥é±è®, for 19.0.0

Is there any settings I need to config?

Thanks.

like image 790
Z.J Hung Avatar asked Sep 02 '19 09:09

Z.J Hung


1 Answers

I face the same issue.. as a temp solution Im converting the ISO_8859_1 String to UTF-8

newValue = new String(wording.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8)
like image 66
benash Avatar answered Nov 16 '22 03:11

benash