Quoting Jens Seidel (jensseidel@users.sf.net): > Hi, > > some email clients use per default a mime type of application/x-gettext for > attached PO files. I'm not aware of any....but my own mutt because I use this in ~/.mime-types: application/x-gettext po As I happen to send quite a lot of PO files and as I gave that trick to a few people around, this is maybe what gives you that feeling of "some mail clients"...:) The rationale of doing this is to prevent mutt to do what it does by default: treat PO files as text/plain *and convert them to its default output charset when sending mail*.....which was one of my worst nightmares when I switched to UTF-8 gradually back in 2004. I still find bug reports where bug reporter sent wrongly encoded PO files because of this. I personnally consider this a bug more than a feature and there may be ways to avoid this weird behaviour of mutt....but I never investigated this further as the "application/x-gettext" does the trick..:-) > I failed to use iconv and to extract the encoding from the PO file itself > without writing an external script. Inline code I tested (already simplified): > > application/x-gettext; iconv -f iso-8859-1 %s; needsterminal; > copiousoutput; test=grep --quiet -i 'Content-Type:.*charset=.*iso-8859' %s Better use "msgconv" as it automatically extracts the originating charset from the PO file, IMHO. I nearly no longer use iconv on PO files because of that feature, indeed..
Attachment:
signature.asc
Description: Digital signature