On Mon, Feb 15, 2010 at 10:08:22PM +0000, 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.
Wierdly if I use the iconv function in PHP I get exactly what I want I have:-
print $t $c = iconv('ISO_8859-1' ,'utf-8' , $t); print $c
and the first print shows the unconverted characters, the second shows correctly accented characters. Why on earth the command line iconv doesn't work the same I really don't understand. Still it doesn't matter much as I actually want to do it in PHP.
(Oh and I have tried a specific "-t utf-8" in the command line and it makes no difference)