0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WindowsのコマンドプロンプトでAWS RDSに接続すると文字化け

Posted at

Laravelでアプリを作っています。

Windows11のコマンドプロンプトで、AWS RDSに接続したらUTF-8で登録したはずのデータが文字化けしていました。
ブラウザ → Laravel → DB のどこかで SJISに変換されてしまったのかと思い、色々調べたのですが、全てUTF-8になっていて問題ありません。

試しに、Windows11のコマンドプロンプト に insert文をコピペで貼り付けたら、その瞬間に文字化けが発生しました。

原因はWindowsのコマンドプロンプトのデフォルト文字コードが Shift_JIS だからでした。

UTF-8のデータにアクセスするときは、コマンドプロンプトの文字コードをUTF-8に変えるか、WSL2のUbuntuで見るようにしたほうがいいですね。

結構ハマりました。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?