Title: RE: Sending MIME emails with base64 encoded attachments

Hello.

That's me, again.

I found a reason of my problem..not solution.

PHP use Cstyle string, where end of string si #0.

Let say I have a small 4byte file with content "AB#0C" (ascii: #65,#66,#0,#67)
I load it (using binary save fread into $txt)
When I try to get third character (#0), quess what I get:
$x = ord(substr($txt,2,1))

$x IS NOT 0!
$x IS 92, which mean backslash. Fourth char is 48, which means "0" and the fifth #67.

So, PHP replaces any #0 with "\0" in every string internally.

Which wouldn't be do bad, BUT:
INTERNAL base64_encode AND base64_decode FUNCTIONS FORGET IT!

That's the reason why I can't read any base64 encoded attachment with external email client.
WHAT A SHAME FOR PHP
(or for me if I'm wrong :-)


What do you thing about that?
Do PHP develop centre know about it?
Does exists any patch?

One possible solution is:
- Write custom base64 encoding/decoding, which will handle the problem (maybe encoding is enough)...

Does somebody have such a function?
Or do you see any other solution?
Or am I completely wrong? :-o


Regards


Petr Svarc

This electronic message transmission contains information from TMP Worldwide
and is confidential or privileged.  The information is intended to be for the use of
the individual or entity named above. If you are not the intended recipient, 
be aware that any disclosure, copying, distribution, or use of the contents of this
information is prohibited. If you have received this electronic transmission in error,
please notify us by telephone immediately at +44 (0)20 7406 3333

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to