php-i18n Digest 7 Feb 2003 09:21:00 -0000 Issue 148

Topics (messages 428 through 440):

Re: mb_send_mail
        428 by: Moriyoshi Koizumi
        429 by: Hayk Chamyan
        430 by: Moriyoshi Koizumi
        431 by: Hayk Chamyan
        432 by: Moriyoshi Koizumi
        433 by: Tony Laszlo
        434 by: Hayk Chamyan
        435 by: Moriyoshi Koizumi
        436 by: Hayk Chamyan
        437 by: Moriyoshi Koizumi
        438 by: Hayk Chamyan

Re: mb_detect_encoding mb_convert_encoding and rss
        439 by: Moriyoshi Koizumi
        440 by: Tony Laszlo

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

Hayk Chamyan <[EMAIL PROTECTED]> wrote:

> 
> I'm  trying  to send a UTF-8 encoded e-mail using mb_send_mail() under
> PHP 4.3.0 with the MBString extension. 
> 
> mb_send_mail() adds the following lines to the e-mail header:
> Mime-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: BASE64
> 
> But it doesn't encode the message body into MIME base64 and I'm forced to use
> mb_send_mail($address, $subject, chunk_split(base64_encode($msg)), $extra_headers);

What if prepending a single line

mb_language("uni");

right before the mb_send_mail() call?



Moriyoshi

--- End Message ---
--- Begin Message ---
Hi.

MK> What if prepending a single line
MK> mb_language("uni");
MK> right before the mb_send_mail() call?

It didn't help. The header in the e-mail source displayed the following:

Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: BASE64

and then the body in the UTF-8 encoding.


-- 
Best regards,
 Hayk
 mailto:[EMAIL PROTECTED]
 icq: 363611

--- End Message ---
--- Begin Message ---
Hi,

It turned out to be a genuine bug, and now fixed in CVS snapshot.

Thanks for the report.

Moriyoshi

Hayk Chamyan <[EMAIL PROTECTED]> wrote:

> 
> Hi.
> 
> MK> What if prepending a single line
> MK> mb_language("uni");
> MK> right before the mb_send_mail() call?
> 
> It didn't help. The header in the e-mail source displayed the following:
> 
> Mime-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: BASE64
> 
> and then the body in the UTF-8 encoding.
> 
> 
> -- 
> Best regards,
>  Hayk
>  mailto:[EMAIL PROTECTED]
>  icq: 363611
> 
> 
> -- 
> PHP Internationalization Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Hi.

MK> It turned out to be a genuine bug, and now fixed in CVS snapshot.
MK> Thanks for the report.

Maybe you need to add some additional functionality to checking additional_headers 
parameter?

Because there can be cases when some parts of e-mail header will duplicated.
Here is an example:

MIME-Version: 1.0
Content-type: text/plain; charset=utf-8
Content-transfer-encoding: 8bit
Date: Thu, 30 Jan 2003 16:15:48 UT
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: PHP
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: BASE64

Last 3 lines added by MBString.

-- 
Best regards,
 Hayk
 mailto:[EMAIL PROTECTED]
 icq: 363611

--- End Message ---
--- Begin Message ---
Hayk Chamyan <[EMAIL PROTECTED]> wrote:
> Maybe you need to add some additional functionality to checking additional_headers 
>parameter?
> 
> Because there can be cases when some parts of e-mail header will duplicated.
> Here is an example:
> 
> MIME-Version: 1.0
> Content-type: text/plain; charset=utf-8
> Content-transfer-encoding: 8bit
> Date: Thu, 30 Jan 2003 16:15:48 UT
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Mailer: PHP
> Mime-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: BASE64
> 
> Last 3 lines added by MBString.

Good point. But isn't it easy thing to avoid this problem by not 
appending those headers that are supposed to be appended by mbstring?

Moriyoshi


--- End Message ---
--- Begin Message ---
On Sat, 1 Feb 2003, Moriyoshi Koizumi wrote:

> Hayk Chamyan <[EMAIL PROTECTED]> wrote:
> > Maybe you need to add some additional functionality to checking additional_headers 
>parameter?

The following is working for me: 

            $headers .= "Content-Type: text/html; charset=utf-8";
            break;

        }
mb_language("uni");
$message = chunk_split(base64_encode($message));
mb_send_mail($to, $subject, $message, $headers);
}

=========================

The only problem I have had is: 

When this goes out to a cellphone in Japan, 
it seems that the attachment does not get converted 
and appears as garble on the cellphone screen. 
The text in the email does not appear, at all... :(

Maybe the cellphone is not able to convert? 
Or is there some adjustment needed, perhaps? 


-- 
Tony Laszlo
http://www.issho.org/laszlo.html



--- End Message ---
--- Begin Message ---
MK> Good point. But isn't it easy thing to avoid this problem by not 
MK> appending those headers that are supposed to be appended by mbstring?

This problem may occur when the mail() function gets reloaded.

-- 
Best regards,
 Hayk
 mailto:[EMAIL PROTECTED]
 icq: 363611

--- End Message ---
--- Begin Message ---
Hayk Chamyan <[EMAIL PROTECTED]> wrote:

> 
> MK> Good point. But isn't it easy thing to avoid this problem by not 
> MK> appending those headers that are supposed to be appended by mbstring?
> 
> This problem may occur when the mail() function gets reloaded.

Do you mean a case where mbstring.func_overload is enabled in 
php.ini? If so, you can use mb_orig_mail() that is prepared as an alias 
for the standard mail() function, though it's undocumented yet...

Moriyoshi

--- End Message ---
--- Begin Message ---
>>
>> This problem may occur when the mail() function gets reloaded.
MK> Do you mean a case where mbstring.func_overload is enabled in
MK> php.ini? If so, you can use mb_orig_mail() that is prepared as an alias 
MK> for the standard mail() function, though it's undocumented yet...

Yes. But I may use some another software, like forum or CMS.

-- 
Best regards,
 Hayk
 mailto:[EMAIL PROTECTED]
 icq: 363611

--- End Message ---
--- Begin Message ---
Hayk Chamyan <[EMAIL PROTECTED]> wrote:

> 
> >>
> >> This problem may occur when the mail() function gets reloaded.
> MK> Do you mean a case where mbstring.func_overload is enabled in
> MK> php.ini? If so, you can use mb_orig_mail() that is prepared as an alias 
> MK> for the standard mail() function, though it's undocumented yet...
> 
> Yes. But I may use some another software, like forum or CMS.

Okay, it sounds like a valid reason to me. I'm going to add that feature.
BTW, I'd be glad if you would put your request at http://bugs.php.net/

Thanks.

Moriyoshi

--- End Message ---
--- Begin Message ---
MK> Okay, it sounds like a valid reason to me. I'm going to add that feature.
MK> BTW, I'd be glad if you would put your request at http://bugs.php.net/

Thank to.

-- 
Best regards,
 Hayk
 mailto:[EMAIL PROTECTED]
 icq: 363611

--- End Message ---
--- Begin Message ---
Hi,

> * While I would gladly write out each and every encoding in 
> existence
> 
> (as you can see from the top page here: 
> http://www.issho.org/ , pretty much every language - and 
> encoding - out there, needs to be supported). 
> 
> a way to wildcard it would be preferred. :)
> Is there not such a way?

Since encoding detection is essentially heuristic and thus its 
accuracy depends on the number of likely candidates given in the first 
place, there is no way to guess a right encoding out of any possible 
encodings from limited length of strings.

Moriyoshi

--- End Message ---
--- Begin Message ---
On Sat, 1 Feb 2003, Moriyoshi Koizumi wrote:

> > (as you can see from the top page here: 
> > http://www.issho.org/ , pretty much every language - and 
> > encoding - out there, needs to be supported). 
> > 
> > a way to wildcard it would be preferred. :)
> > Is there not such a way?
> 
> Since encoding detection is essentially heuristic and thus its 
> accuracy depends on the number of likely candidates given in the first 
> place, there is no way to guess a right encoding out of any possible 
> encodings from limited length of strings.

Thank you. 

Some people are apparently using the Encode::HanDetect perl module to 
guess the encoding the feed based on statistical heuristics. 

Too imperfect to try, or something that can be done with perl 
but not with php? 



-- 
Tony Laszlo
http://www.issho.org/modules.php?op=modload&name=phpWiki&file=index&pagename=LaszloBlog
(going for the record: blog with the longest URL)



--- End Message ---

Reply via email to