0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

文字化けを防ぐ

Posted at

はじめに

取引先から受領したデータをDB登録してきちんと登録されたか画面上で確認するときに文字化けが起きていることが稀にありました。(DB登録せず、HTML上に直接記載したときとかも。。)
本記事は、そのときの対応内容を残した備忘録となります。

文字化けを防ぐには

原因としては、記号・特殊文字などの環境依存文字を使用していたため。
記号・特殊文字を使用したい場合は、「文字実体参照」か「数値文字参照」に置き換える必要がある。
こちらのサイトでよく使われる記号やマークの文字コード表がまとまっているので、確認するとよい。
HTMLの記号・特殊文字の文字コード表(文字実体参照、数値文字参照)

環境依存文字チェッカーの紹介

文字化けが起きてから、文字コード表を確認して修正するのは面倒です。
受領したデータに環境依存文字が含まれているか事前に知るためのツールとして下記サイトが有用です。
機種依存文字チェッカー

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?