LoginSignup
1
1

More than 5 years have passed since last update.

vue.js内の日本語が文字化けする

Last updated at Posted at 2018-01-22

概要

vue.jsを書いていた時に日本語が文字化けしたのでメモ

// テスト

上記のように書いていたのが

// %F%9%H

こんな感じになる。

解決策

文字コードを確認する

コマンドインストール

sudo yum install nkf

日本語が入っていない状態

nkf -g src/components/HelloWorld.vue
ASCII

日本語が入っている状態

nkf -g src/components/HelloWorld.vue
ISO-2022-JP

なぜかUTF8じゃない

UTF8に変更

nkf -w --overwrite src/components/HelloWorld.vue

これで文字化けしなくなった。

これをやらないといけないのは自分の環境のせいなきがする。。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1