Re: MIME-aware recode or iconv?

Date: Thu Jan 15 2004 - 15:23:23 EST

  • Next message: John Hudson: "Samaritan shin symbol (Was: Aramaic unification and information retrieval)"

    Frank da Cruz scripsit:

    > Is anybody aware of a Unix stdin/stdout application (suitable for
    > piping) that converts a text stream from one character encoding to
    > another based on its MIME headers (as you would find, for example, in
    > an email message)?

    The following script is not bulletproof, but it should work in most cases:

    cat >$TMP
    CHARSET=`perl -ne 'print "$1\n" if /^Content-Type:.*charset="([^"]*)/i' <$TMP`
    iconv -f $CHARSET <$TMP

    Winter:  MIT,                                   John Cowan
    Keio, INRIA,                          
    Issue lots of Drafts.                 
    So much more to understand!           
    Might simplicity return?                        (A "tanka", or extended haiku)

    This archive was generated by hypermail 2.1.5 : Thu Jan 15 2004 - 16:08:41 EST