Re: [PHP-I18N] MBStrings question for in PEAR::Mail_Mime

[email protected] ("Cipriano Groenendal")
Newsgroups php.i18n
Message-ID <[email protected]>
Hello,

> It'd not be a good idea to use mb_encode_mimeheader() as it is not quite
> handy
> when it comes to non-CJK encoding. Instead, you can write a more
> standard-compliant
> alternative with mb_substr() / base64_encode(), or possibly
> iconv_mime_encode() that
> provides far better functionality, available since php 5.0.


Thanks for the info!
I've implemented the iconv_mime_encode function in the Mail_Mime package as 
you can see at 
http://cvs.php.net/viewcvs.cgi/pear/Mail_Mime/mime.php?annotate=1.56#l791
In that function, I only call the replacing function if the line to encode 
contains characters that should be encoded. This is currently done with a 
regexp but I fear it might not always find all the characters.
The regexp I'm using searches for [\x80-\xFF]. This would catch any cyrilic, 
or otherwise, xtened single byte characters in charsets such as ISO-8859-XX. 
Would this work in etecting all multibte charaters, or do you know a better 
way to determine whether or not to encode a line ?

Thanks again,
Cipri
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.