Comments (2)
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.
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)
- Force parse text file attachment as file when Content-Disposition: attachment header HOT 4
- File name too long when parsing attachments HOT 7
- Flags not fetched correctly from GMail HOT 1
- Iconv error on zetacomponents/mail/src/internal/charset_convert.php line 14 HOT 2
- User names and passwords can contain spaces. HOT 1
- bug in parser/parts/text_parser.php HOT 4
- create_function() is deprecated in PHP 7.2
- How to use Zeta Mail Component in Laravel HOT 1
- IMAP TLS Auth for accessing mailbox HOT 1
- Notice: iconv(): Detected an illegal character in input string HOT 1
- Attachment filename too long HOT 2
- Incompatible regex with PHP 7.3 HOT 3
- ezcMailTools::mimeHeaderEncode Timeout HOT 2
- Issue with civicrm-core HOT 2
- Undefined variable in imap_set.php HOT 1
- .msg attachment HOT 4
- Curly-brace syntax for array and string access is deprecated in PHP 7.4 HOT 1
- SRS return path issues - causes whole email to fail to process HOT 4
- IMAP / POP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mail.