文字コードの自動判定のしくみと、うまくいかないとき
この記事のポイント
- 自動判定の結果を見る
- 読み取りを手動で変える
- 表示が直ったら変換する
文字コードを変換する は、ファイルの先頭と、バイトの並びから、文字コードを推定します。
手順
- ファイルを選び、「自動判定:」の表示を見る
- 文字が化けていたら、「今の文字コード」を別のものにする
- 下の表示が正しくなったら、変換する
短いファイルは、判定を間違えやすいです。表示を見て、手動で選び直してください。
文字コードを変換する(文字化けを直す)を使う(無料)
あわせて使えるツール
- CSVとJSONを相互変換する:CSVとJSONを、すぐに相互変換します。
- CSVをExcelファイルにする:CSVを、Excelで開ける .xlsx ファイルにします。
- 文章の改行を消す・整える:PDFなどからコピーした文章の改行を整えます。
同じツールの、ほかの解説
How Encoding Auto-Detect Works and What to Do When It Fails
Key points
- Check the detected encoding
- Change the reading manually
- Convert once it looks right
Convert Text Encoding guesses the encoding from the start of the file and its byte patterns.
Steps
- Choose the file and read the "Detected:" line
- If it is garbled, pick another "Current encoding"
- When the preview looks right, convert
Short files are easy to misjudge. Check the preview and choose manually if needed.
Use "Convert Text Encoding (Fix Garbled Text)" (free)
Tools that go well with this
- Convert CSV and JSON: Convert between CSV and JSON instantly.
- Convert CSV to Excel (.xlsx): Convert a CSV to an Excel (.xlsx) file.
- Remove and Tidy Line Breaks in Text: Tidy line breaks in text copied from PDFs and elsewhere.