in reply to Putting a utf-8 subject into a mail header

Try uppercase "UTF-8"
  • Comment on Re: Putting a utf-8 subject into a mail header

Replies are listed 'Best First'.
Re^2: Putting a utf-8 subject into a mail header
by talexb (Chancellor) on Feb 27, 2009 at 15:27 UTC
      Try uppercase "UTF-8"

    I tried it in the decode script and got

    Unknown PerlIO layer "UTF8" at /home/talexb/bin/decode line 17.
    Is there somewhere else that you think the case of 'utf' matters?

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      Sorry, i was thinking
      binmode STDOUT, ':encoding(UTF-8)';
      might make a difference, but you need
      encode("MIME-Header",decode('UTF-8',$arg)));

        Wow. It works. I'm not sure I understand, but I'll save that for later.

        Thank you. :)

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      To expand on what Anonymous Monk said, @ARGV is one of those things in Perl (like filenames), where Unicode isn't handled automatically, so you need to explicitly decode your input.

        I thought I read yesterday in the Camel that @ARGV *did* handle utf-8, otherwise I would have pursued that possibility. Now, of course, I can't find the page that I thought I read. In my case, the input's coming from a web form .. so I may need to do the same thing for another problem I'm having.

        It would be awesome if this solution solves that problem as well. :)

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        or add
        #!/usr/bin/perl -CDSLA
        -C is -CDSL