问题
I have a SAPUI5 application. The translated text is shown wrongly in a dialog, while the translation is shown correct in the launchpad. Please see the following picture:
While the translation file is loaded for German language, it does not show [ÖÄÜß] correctly in the dialog. However it doesshows ö correctly in the launchpad page.
How can I solve it?
回答1:
Try setting /resources/configuration/propertiesFileSourceEncoding
to UTF-8
in the tooling configuration file (typically ui5.yaml
).
In
ui5.yaml
:resources: configuration: propertiesFileSourceEncoding: UTF-8
And in
package.json
:"devDependencies": { "@ui5/cli": "<at least 1.7.0>", ... },
Re-build and deploy the app again.
About propertiesFileSourceEncoding
This option specifies the source encoding of
*.properties
files of the project. Those files will be read in the given encoding and any non-ASCII characters replaced with the respective unicode escape sequences. (doc)
来源:https://stackoverflow.com/questions/58834203/translation-does-not-show-non-ascii-characters-correctly