Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Email::MIME support for utf8 filename

by Corion (Patriarch)
on Dec 25, 2018 at 10:37 UTC ( [id://1227688]=note: print w/replies, xml ) Need Help??


in reply to Email::MIME support for utf8 filename

Please help us help you better by answering the following questions:

  1. What is your code? Please edit your post and add the relevant code to it. Ideally you replace all variable parts that are read from files with hardcoded values. Make sure that the problem persists with the hardcoded values.
  2. How did your code "crash"? Please edit your post and add the exact error message you got from your code. We can't help you much without the error message, the line number and the code matching to that line number.
  3. Have you made sure that the problem is related to UTF-8-encoded filenames at all? Does the same code work with plain ASCII filenames? Please try out (and tell us about) the variations to find out the root cause of the problems.
  4. Are you certain that the filename is UTF-8? Not all filesystems and file system APIs encode non-ASCII filenames as UTF-8. For example on Windows, you need to use special versions of the file system API (the "Wide" functions) to access filenames with non-ASCII parts. See for example Win32::LongPath for a module that uses the Wide APIs.
  • Comment on Re: Email::MIME support for utf8 filename

Replies are listed 'Best First'.
Re^2: Email::MIME support for utf8 filename
by Arik123 (Beadle) on Dec 27, 2018 at 07:29 UTC

    Does my edit (to the original post) satisfy you?

      Yes, that makes it much easier to find where the warning originates:

      The warning comes from Email::MIME::ContentType line 106:

      if ($STRICT_PARAMS and length $ct and $ct !~ /^;/) { carp "Missing semicolon before first Content-Type parameter '$ +ct'";

      So, one very simplistic workaround is to set $Email::MIME::ContentType::STRICT_PARAMS to 0 to suppress this warning.

      I don't know where/why the content type string goes awry, but that's to debug another day...

        Okay, that worked. Interestingly, it not only suppressed the warning, but also, below in the code, enabled Email::MIME to really extract the filename....

        Thanks a lot!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found