#13097 [Com]: strange linebreaks in decoded base64 string
| From: | darleyr at yahoo dot com | Date: | Sun, 10 Oct 2004 20:51:31 +0000 |
| Subject: | #13097 [Com]: strange linebreaks in decoded base64 string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67368@lists.php.net to get a copy of this message | ||
ID: 13097
Comment by: darleyr at yahoo dot com
Reported By: simon at hornweb dot ch
Status: Bogus
Bug Type: IMAP related
Operating System: WinNT 4.0
PHP Version: 4.0.4pl1
New Comment:
imap_base64 is not working for me , Iam just EMAILING NOTEPAD.EXE
(68,096 bytes) but when I use imap_base64 on the part and download it
via browser header it is showing NOTEPAD.EXE (68,990 bytes) and not
opening
Previous Comments:
------------------------------------------------------------------------
[2002-05-28 13:02:24] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
------------------------------------------------------------------------
[2001-09-03 06:39:59] simon at hornweb dot ch
Hello
I got the body of the file with imap_fetchbody (), then decoded it with
imap_base64 and saved it in a file. I opened the new file with the
Notepad and the original file as well. The text was exactly the same
but
these strange linebreaks. These linebreaks aren't chr (10) or chr (13)
or
something like that. I wrote a script who reads the file and puts out
every char in the file followed by his ASCII number and a linebreak and
it put out something like that.
/0
/0
A/65
/0
B/66
/0
(Sorry, I don't have the correct ASCII numbers in my head)
So after the fourth char in this example there's a linebreak without an
ASCII number, so I can't open the file. (of course I can open it, but
the
programm will put out an error message and nothing else).
This problem appears only with base64 decoding. I don't have troubles
with the imap_qprint () function.
so long, Simon
http://www.hornweb.ch
(I can't bring you an original example produced by my script, because I
get a "PHP has encountered an Access Violation at 0CC92466" message
and our fucking computershop chief won't be there to restart it until
6)
------------------------------------------------------------------------
[2001-09-02 16:41:25] sniper@php.net
Do you happen to read that file with fopen() / fread() ?
Can you attach a complete but short example script?
--Jani
------------------------------------------------------------------------
[2001-09-02 15:46:48] simon at hornweb dot ch
imap_base64 seems to produce strang linebreaks in a decoded string.
For example, I've a JPEG file to decode. The original file starts with
the line
ÿØÿà JFIF H H ÿíjPhotoshop 3.0 8BIMí H H
8BIM
x8BIMó 8BIM
8BIM'
8BIMõ H /ff lff /ff ¡ 2 Z
5 - 8BIMø p ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè 8BIM @ @ 8BIM
8BIM Ù W p s ½ ÿØÿà JFIF H H ÿþ &File
written by Adobe Photoshop¨ 5.0ÿî Adobe d ÿÛ
ÿÀ p W"
ÿÝ ÿÄ?
3
!1AQa"q2¡±B#$RÁb34rÑC%Sðáñcs5¢²&DTdE£t6ÒUâeò³ÃÓuãóF'¤
´ÄÔäô¥µÅÕåõVfv¦¶ÆÖæö7GWgw§·Ç×ç÷
5
!1AQaq"2¡±B#ÁRÑð3$bárCScs4ñ%¢²&5ÂÒDT£dEU6teâò³ÃÓuãóF¤
´ÄÔäô¥µÅÕåõVfv¦¶ÆÖæö'7GWgw§·ÇÿÚ
? ôGØácã¡Ò¢ÛÚÇîkµÀÈ
(sorry for this long stuff)
but the imap_base64 decoded string starts with
ÿØÿà JFIF H H ÿíjPhotoshop 3.0 8BIMí H H
8BIM
x8BIMó 8BIM
8BIM'
These linebreaks don't seem to have any ASCII number or something,
they're just linebreaks.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=13097&edit=1