I have files of ISO-8859 encoded Text sent to me regularly by customers that contain debug information.
Recently, they have started to turn up in my inbox as ASCII encoded with a few extra characters in the file as a result, breaking the parser I wrote for these files.
I narrowed it down to the E-Mail Client being used by the customer which changes encoding.
Is it possible to revert this false change of encoding?
Because I'm working with Linux, I'd favor a solution for Linux but would be interested in solutions for other OSes as well.
Here's some output for reference and information:
$ file /tmp/{wrong,right}_enc.txt
/tmp/wrong_enc.txt: ASCII text
/tmp/right_enc.txt: ISO-8859 text, with very long lines, with CRLF line terminators
$ file -bi /tmp/{wrong,right}_enc.txt
text/plain; charset=us-ascii
text/plain; charset=iso-8859-1
Content examples (Info is different, structure should be the same but wrong_enc.txt has aditional characters behind '=' and at EOL for example):
$ head /tmp/{wrong,right}_enc.txt
==> /tmp/wrong_enc.txt <==
Tue Jun 11 15:51:54 2019=0D
=0D
=0D
###Eth-eth0-driver =3D igb=0D
###Eth-eth0-ipaddr =3D 192.168.99.100=0D
###Eth-eth0-link =3D yes=0D
###Eth-eth1-driver =3D e1000e=0D
###Eth-eth1-ipaddr =3D =0D
###Eth-eth1-link =3D no=0D
==> /tmp/right_enc.txt <==
Wed Apr 17 16:47:21 2019
###Eth-eth0-driver = e1000e
###Eth-eth0-ipaddr = 192.168.178.35
###Eth-eth0-link = yes
###Eth-ethnames = eth0
###Eth-ethtool-eth0 =