A N
A N

Reputation: 404

Special characters not getting displayed correctly in html button Title

I know this is very basic question, but we are tumbled on to it.

We have a simple button in HTML file

<button data-dojo-type="dijit/form/Button" id="reset" name="reset" title="This is Reset button">Reset</button>

We have implemented the internationalization using dojo i18n feature and have provided appropriate French translation of the title property of the button as R&#233;initialiser la recherche.

The special characters in that message gets displayed correctly in French if I use that message to display the HTML label like Réinitialiser la recherche. But when I use the same i18n message in html button's title property, it is getting displayed as it is in the properties file R&#233;initialiser la recherche.

Has anyone faced this issue or know the trick to display special characters in Button's title property?

Thanks in advance.

Upvotes: 1

Views: 1059

Answers (2)

A N
A N

Reputation: 404

The issue was resolved when we used R\u00E9initialiser la recherche instead of R&#233;initialiser

Upvotes: 1

Jack Bashford
Jack Bashford

Reputation: 44135

If you want to display special characters in a title attribute, you can just enter the character itself (use é not &#233;), you just need a character encoding. Add the following <meta> tag to your <head>:

<meta charset="utf-8" />

And then set your button's title attribute like so:

title="Réinitialiser la recherche"

And it should work.

Upvotes: 0

Related Questions