Bug #13097 Updated: strange linebreaks in decoded base64 string

From: Date: Mon, 03 Sep 2001 10:39:59 +0000
Subject: Bug #13097 Updated: strange linebreaks in decoded base64 string
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64946@lists.php.net to get a copy of this message
ID: 13097 User updated by: simon@hornweb.ch Reported By: simon@hornweb.ch Old Status: Feedback Status: Open Bug Type: IMAP related Operating System: WinNT 4.0 PHP Version: 4.0.4pl1 New Comment: 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) Previous Comments: ------------------------------------------------------------------------ [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@hornweb.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"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷ 5 !1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£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

« previous php.dev (#64946) next »