Some notes on troubleshooting different encodings for sent/received files.

Table

EncodingåäöÅÄÖ
UTF-8\c3\a5\c3\a4\c3\b6\c3\85\c3\84\c3\96
latin1\e5\e4\f6\c5\c4\d6
CP437\86\84\94\8f\8e\99
CP850\86\84\94\8f\8e\99

Notes

  • WINDOWS-1252 / CP-1252 is a superset of latin1
  • All encodings are supersets of ASCII, so \20=SPACE and \0a=NEWLINE
  • Sometimes you will encounter the “ANSI”-encoding. That name is a lie, and means that the creator is stupid in the head. There is no way of knowing what the creator intends, so you will have to try one encoding at a time and hope for the best.

Vim commands

If you hover over a character and type ga, you will see the VIM interpretation of the encoding. Note that this will NOT necessarily be the FILE-encoding, but instead the VIM-encoding.

# BASH
vim -b FILENAME   # Open vim and see binary (doesn't always work)

# VIM
:e ++enc=1252 filename.txt # Reinterpret file as WINDOWS-1252
%!hexdump -C               # Read whole file as hex (if desperate)