'Language special characters in vue.js template badly encoded
I just started to learn Vue.js and already have a problem. Special characters are badly encoded in templates.
<template>
<div class="navbar">
<span>VOD</span>
<ul class="menu">
<li v-if="user">Konto</li>
<li v-if="!user">Zaloguj się</li>
</ul>
</div>
</template>
It's displayed like this: Zaloguj si�. In built js it looks like this: Zaloguj siďż˝. Same thing with text in variables. Is this normal behaviour for Vue.js?
Solution 1:[1]
Include this in your <head> tag inside your index.html file:
<meta charset="utf-8">
Solution 2:[2]
In my case, it was the bad encoding of the template file (Home.vue) that VS2019 created automatically. When I saved is as UTF-8 the special characters were displayed just fine.
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 | jeerbl |
| Solution 2 | goodfellow |
