My Day✳All blog articles ↗

Preserve letters with an explicit text encoding

Check decoding without changing the original bytes.

Correct delimiters do not guarantee correctly read letters. Encoding determines how bytes become text. Preserve the original bytes, choose the established encoding and compare a control word before saving over anything.

café: 4 characters; UTF-8 without BOM: 5 bytes
café: 4 characters; UTF-8 without BOM: 5 bytes

What to do

  1. Keep the source file separate and identify its known byte encoding.
  2. Read those same bytes with the selected encoding and check the specific control word.
  3. Save the setting and check result; never overwrite the source with the wrong view.

Example

Fictional café, using precomposed é, is UTF-8 without BOM: 63 61 66 C3 A9. That is 4 characters and 5 bytes. Latin-1 decoding gives café; decoding the original bytes as UTF-8 gives café again. UTF-8 and the control word are recorded. No import into My Day is assumed.

My Day · Windows

Save this note manually in My Day.

Buy My Day for Windows ↗