On Mon, Feb 15, 2010 at 10:37:16PM -0000, Ted Harding wrote:
On 15-Feb-10 22:08:22, Chris G wrote:
I have an E-Mail (well lots actually) which has a text part with headers as follows:-
Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
My system is all utf-8 now so just outputting the E-Mail via 'more' or opening it in vi doesn't decode/show the accented characters correctly.
Mutt reads the above headers and converts the accented characters and shows them correctly.
I want to do some processing on this file and then display the text parts but at the moment I can't get anything to do what mutt appears to be able to do with no effort! E.g. I have tried:-
iconv -f iso-8859-1 <filename>
and it doesn't change anything at all. Nor does viewing the file in Firefox with the charset set to iso-8859-1 work.
What am I missing? It must be something blatantly obvious.
Quite possibly ...
According to 'man iconv' you should need *both* -f and -t:
SYNOPSIS iconv -f encoding -t encoding inputfile
Also, "iconv --list" lists the charset names in CAPITALS. . So maybe try
iconv -f ISO-8859-1 -t UTF-8 <filename>
It also lists ISO-8859-1, ISO8859-1 and ISO_8859-1 which are presumably equivalent [... ??].
Shooting not-quite-in-the-dark (illumination from 'man'), since I've never used this!
It *shouldn't* need the "-t UTF-8", my "man iconv" says:-
--to-code, -t encoding Convert characters to encoding. If not specified the encoding corresponding to the current locale is used.
... and my locale is most definitely UTF-8.
But, if I do:-
iconv -f ISO-8859-1 -t UTF-8 /home/chris/Mail/boating/buyOurBoat/fredMolina/cur/1259766690.21706_55.chris:2,RS | more
It still doesn't work.