Search code examples
javascriptangularjsutf-8special-charactersdirective

How can I use special characters in angular directives attributes?


I would like to use strings including german characters (Ä, Ö, Ü) in attributes of a custom angularJS directive.

For example:

<my-custom-directive my-label="Lärm" />

Another example is the ui.bootstrap.tabs directive:

<tabset>
   <tab heading="Lärm"> content ... </tab>
   <tab heading="Second Heading"> content ... </tab>
</tabset>

This results in a tab with heading "L�rm". Any ideas?


Solution

  • Usually in a good editor you can change the document encoding type, the document is saved in. try to set it to iso-8859-1/utf-8 and save/upload again.

    Next bet would be to change the encoding of the html-output with

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    

    Umlauts often is trial & error...