Adding unicode in ion-tab directives

Hi guys,

I have created an app with tabs, I wanted to add tab title with some non-English characters such as Chinese.

<ion-tab title="**chinese-title**" icon-off="ion-android-contacts" icon-on="ion-android-contacts" href="#/tab/contacts">
        <ion-nav-view name="tab-contacts"></ion-nav-view>

But, when I test the app, the tab title shows ???. So any idea how I can add non-English titles?


I copy/pasted some Chinese words I found and it works fine.
Are you sure your HTML file is encoded in utf-8?

Thanks, gmarziou. it works after converting to utf-8. thanks again.


I am trying to include Chinese characters in a *.ts file (Ionic 2) and the encoding of the TS-file itself seems UTF-8. But Typescript complains about illegal character.

Presenting Chinese characters works usingdecodeURIComponent('%E5%90%8D%E5%89%8D');, but I want to do something like:

var translations:Array<string> = ['signup6”:“注册”,etc....]

Do I need to configure tsconfig.json to accept utf-8? Cant seem to find that option. Any help appreciated!!

I dont expect adding UTF encoding to index.html will help, as this problem happens at transpile time?


1 Like