cancel
Showing results for 
Search instead for 
Did you mean: 

Strange encoding after production build of SAPUI5 app

julian-s
Participant

Hello,

We are currently facing a problem with the WebIDE deployment process to our own SAPUI5 ABAP Repository.

We have a prepared an i18n.properties file, where all the German strings are saved.

If we start the application on the WebIDE itself, then the encoding of the strings works perfectly as expected. But when we are now trying to build and deploy the app on the ABAP repository, it will fail with the encoding. During the build process on the WebIDE, it convert the the i18n properties file in another encoding. We see the file here from the dist folder.

As a result, we see a wrong encoded application:

Now the question is, what can we do to set the correct charset and get the expected result.

Thanks in advance.

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

Could you share package.json and ui5.yaml with us? Seems like a common issue UI5 devs encounter nowadays. One of the solutions would be to tell the tooling to read the *.properties files with UTF-8 when converting. See https://stackoverflow.com/a/58835799/5846045

View Entire Topic
julian-s
Participant

I have build and deployed it now again and suddendly the property files are now showing up correctly. Maybe the WebIDE showed up an older version of the dist properties file. It works now, thank you very much.

Update: But I have added an additional thing in the package.json. When I add

--exclude-task escapeNonAsciiCharacters

to the build tag, then it will display the characters also in the dist folder correctly and in the end on the productive system.

So my package.json looks now like this:

{
  "name": "zmmwe",
  "version": "0.0.1",
  "description": "",
  "private": true,
  "devDependencies": {
    "@ui5/cli": "1.7.0",
    "@sap/ui5-builder-webide-extension": "1.0.5"
  },
  "scripts": {
    "build": "ui5 build --include-task=generateManifestBundle --exclude-task escapeNonAsciiCharacters generateCachebusterInfo"
  },
  "ui5": {
    "dependencies": [
      "@sap/ui5-builder-webide-extension"
    ]
  }
}
boghyon
Product and Topic Expert
Product and Topic Expert

Hi Julian,

The --exclude-task escapeNonAsciiCharacters command could be a workaround but we still believe that it shouldn't be necessary.

Without that command, if you build with propertiesFileSourceEncoding: UTF-8, do you still see Bez/u00c3/u00bcger (Bezüger)? Or is it Bez\u00fcger (Bezüger) in the *.properties file?

julian-s
Participant
0 Kudos

Hi boghyon.hoffmann,

No I still saw the Bez/u00c3/u00bcger (Bezüger) when I just updated the .yml file.