Picture of nickname
Registered 3 years 37 days
nickname Thursday, 12 May 2022, 12:55 AM
Translations in the js runtime
Dear innovaphone forum,

When I try to add translations some characters dont display in the right way.

For example: äöü -> ���

Translating in the c++ app always worked, but in the js runtime the encoding doesnt seem to work probably.

Is there a recommend solution how to fix this issue?


Code:

newapp1.js:
that.add(new innovaphone.ui1.Div().addTranslation(texts, "test"));

newapp1.texts.js:
en: {
        test:"aou",
    },
    de: {
        test:"äöü",
    }



Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 121 days
Daniel Deterding (innovaphone) Thursday, 12 May 2022, 06:51 AM
Re: Translations in the js runtime
Hi Nick,

did you take care that your js files are saved with UTF-8 encoding? Some editors (and visual studio) may encode the files with a different encoding by default.

In addition, the htm files you're using must provide the tag <meta charset="utf-8"/>
The template application already contains a suitable htm file.

Greetings,
Daniel
Picture of nickname
Registered 3 years 37 days
nickname Monday, 16 May 2022, 11:21 AM
Re: Translations in the js runtime
You were right. It was because Visual Studio does not save it as UTF-8.

This is how you solve it:
Go to newapp1texts.js
Click Save As
Click on the arrow next to save button and select "Unicode (UTF-8 Signature)"
Overwrite current newapp1texts.js
← You can define your color theme preference here