icerockdev / moko-resources

Resources access for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
1.07k stars 120 forks source link

localization of unicode characters #376

Open kramlex opened 2 years ago

kramlex commented 2 years ago

string.xml in shared module:

<string name="common.smile">\uD83D\uDE00</string>

generate in androidMain multiplatform-strings.xml

<string name="common_smile">\uD83D\uDE00</string>

generate in Localizable.string file from iOS framework

<string name="common_smile">\uD83D\uDE00</string>

when calling the localize() function from iOS, the string uD83DuDE00 is returned

it is necessary that unicode characters for iOS are generated with \\u

or

if you use the U+... notation to describe unicode characters inside an xml file, then \\u is generated for iOS and for Android too \\u, for android, this is an incorrect character

kevincianfarini commented 10 months ago

We are seeing this, too.

guillermolc commented 7 months ago

same issue here

i found some alternative solution i'm traying use: <string name="please_dialog_modal">Please\u0020</string> on android is working fine, but on ios it's displaying the unicode value u0020 with this change i can see the space <string name="please_dialog_modal">Please&#160;</string>

Endless-Lemniscate commented 4 months ago

@guillermolc Not worked for me. In resources i have   but in multiplatfrom_strings file its turns to \u00A0 and displaying in is like u00A0