wortigern
wortigern

Reputation: 181

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?

Upvotes: 5

Views: 9725

Answers (2)

goodfellow
goodfellow

Reputation: 3735

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.

Upvotes: 3

Sletheren
Sletheren

Reputation: 2486

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

<meta charset="utf-8">

Upvotes: 4

Related Questions