Firebase Remote Config with Chinese characters
Asked Answered
B

1

6

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.

Byblow answered 2/9, 2019 at 9:40 Comment(2)
Please file a bug report with Firebase support. support.google.com/firebase/contact/supportVieira
Hi @DougStevenson, I've filed a bug report, but I'm sorry that I forgot to attach this stackoverflow link. :(Byblow
J
5

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)
Jo answered 2/9, 2019 at 14:58 Comment(4)
Thanks. I've also tried this workaround. However, I am wondering if it is always ISO-8859-1 or it would be other encoding?Byblow
Firebase developer replied that it is a known bug and it will be fixed in next release. I'll mark @Jo 's answer as correct since it temporarily solves my problem for now.Byblow
as i can see in my app, this solution is no longer neededJo
Yes, version 19.0.1 fixed the problem.Byblow

© 2022 - 2024 — McMap. All rights reserved.