How to set UTF-8 in Vue.js, correctly?

Using Vue.js and Vue-meta, I configured utf-8 in my App.vue as follow:

    metaInfo() {
        return {
            title: 'My',
            titleTemplate: '%s | Titulo',
            meta: [
                { equiv: 'Content-Type', content: 'text/html; charset=utf-8' },
                { name: 'viewport', content: 'width=device-width, initial-scale=1' }                 

            ]
        }
    },

But is not working, when my webpage is rendered, tildes, accents are not setted. For example, these symbols always are showed �, instead ó. "Integraci�n".

How can I configure this issue?

Could you help me with this issue, please? Thks

Upvotes: 1

Views: 6267

Answers (1)

cam
cam

Reputation: 3616

Move the charset=utf-8 into it's own object within the meta array:

    metaInfo() {
        return {
            title: 'My',
            titleTemplate: '%s | Titulo',
            meta: [
                { charset: 'utf-8' },
                { equiv: 'Content-Type', content: 'text/html' },
                { name: 'viewport', content: 'width=device-width, initial-scale=1' }                 

            ]
        }
    },

Upvotes: 1

Related Questions