on 04-17-2014 6:24 PM
Hi guys,
I was doing some testing on i18n encoding.
I wrote a german word: "Hinzufügen" but when sapui5 reads it, it becomes "Hinzuf�gen"
What is wrong with this?
I have set it correctly.
var model = new sap.ui.model.resource.ResourceModel({bundleUrl : "test.properties", bundleLocale : "de" });
sap.ui.getCore().setModel(model, "i18n");
Thanks.
A Deeper search and I found a way to convert the properties file.
As the properties file needs to be in escape Unicode in order to work,
i have used the native2ascii tool from JDK to do so.
hope this finding can help others too!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anand,
If i recall correctly, i was using this tool.
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/native2ascii.html
it has been 6 years since i have touched SAPUI5. I really doubt you would still need this tool as i expect SAPUI5 to handle this natively. Have you try the below different approaches mentioned by the others?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I have tried them and the \u… is working.
But why do I have to do that?
Is that a way to make this work without having to change all the unicode 8 characters?
Can I change it in the js level on how UI5 is loading the properties?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
can you try defining your i8n value as Hinzuf\u00FCgen instead of Hinzufügen
Regards
Sakthivel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
are you using utf-8 encoding?
in the index.html - head section , mention
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Chris,
same is the problem i am facing, when implementing i18n for french.
the output in chrome shows � for any special character. i have tried everything with the meta tag in index.html but all futile.
Although, if i alert any special character with the character replaced by its special code, like &12sc; within the controller, the special character appears in alert.
All i think is that, we need to write a logic in the formatter function, which will read if the word has any special character, and if so replace the special character with its code.
Pl update if you get any breakthrough.
Regards,
Viren
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.