Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 718
wortigern Avatar asked Mar 02 '18 16:03

wortigern


2 Answers

Include this in your <head> tag inside your index.html file:

<meta charset="utf-8">
like image 85
Sletheren Avatar answered Oct 19 '22 06:10

Sletheren


In my case, it was the bad encoding of the template file (Home.vue) that VS2019 created automatically. When I saved it as UTF-8 the special characters were displayed just fine.

like image 3
goodfellow Avatar answered Oct 19 '22 06:10

goodfellow