'Vue - Handle non English characters in an attribute

I have a Vue app that is hosted in an ASP.NET MVC server

Inside one of my Vue templates, I have this code

<button title="@MyResxFile.Tooltip">
...
</button>

Everything works fine when I'm in English
But whenever I change the site language to something else (e.g. Spanish) that contains non ascii characters, This is the text that I get when I hover over the button

Categor&#237;a

(Supposed to be Categoría)

This happens only inside a Vue template, parts of the site which don't use Vue, don't suffer from that problem.

Please advice.



Solution 1:[1]

You can use the v-html (wiki) directive. If you have the correct charset it should work fine. But be careful with this directive. XSS attacks can be very dangerous.

Hope it fixes your problem.

Solution 2:[2]

I was facing the same issue in vue-router for non english characters (ex: Persian), the solution is to use decodeURI('Categoría').

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ondolin
Solution 2 Pouya M