Giter VIP home page Giter VIP logo

Comments (2)

derickr avatar derickr commented on July 19, 2024

Hi!

We are aware that there are many weird mail servers out there. We can not possible implement hacks for all weird things mail servers do, that's why we made it possible to override things like the character set conversion.

We have a section in our tutorial to explain how to do this: http://zetacomponents.org/documentation/trunk/Mail/tutorial.html#parsing-iconv-notices

In your case, you want to create a new class "myMailCharsetConvertor" implementing the following static method:

class myMailCharsetConverter
{
     public static function convertToUTF8WithHotmailHack( $text, $originalCharset )
     {
         if ( $originalCharset === 'unknown-8bit' || $originalCharset === 'x-user-defined' )
         {
             $originalCharset = "latin1";
         }
         if ( $originalCharset === 'unicode-1-1-utf-7' )
         {
             $originalCharset = "utf7";
         }
         return iconv( $originalCharset, 'utf-8', $text );
     }
}

Then before you run the mail parser, include the following in your code:

ezcMailCharsetConverter::setConvertMethod( array( 'myMailCharsetConvertor', 'convertToUTF8WithHotmailHack' ) );

cheers,
Derick

from mail.

speller avatar speller commented on July 19, 2024

Don't understand what's problem to have an array of mappings of such encodings. To prevent many users to have the same problems. But it is your right to decide what to do.

I created this issue because some implementations of the iconv library support this encoding, some not. If based on libiconv - will support. If based on glibc - will not support. So your code will work dirrerently on different servers. That's not good in my opinion.

from mail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.