LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-24-2007, 04:45 PM   #1
vargadanis
Member
 
Registered: Sep 2006
Posts: 248

Rep: Reputation: 30
PHP Mail Header decode =?iso-8859-2?B?QmFs4XpzIEJvZPM=?=


Hi!

I am trying to create a simple webmail for my cellphone in WML with PHP backend. The thing is that it doesn't go well because there are some mails that is just impossible to deal with. Or at least for me. It looks like:
Quote:
=?iso-8859-2?B?QmFs4XpzIEJvZPM=?=
This is the output of the following:
Code:
$header = imap_headerinfo($conn, $msg_num);				
$name = $header->from[0]->personal;	
print $name;
Not nice, ehh? It is a 7BIT message. I found the imap_8bit that could solve my problem easily but this is a 7bit message. And it seems that there is not much of connection between the encoding of the mail and the headers. What is the logic behind that thing? How can I decode that header?

Thx...
 
Old 03-24-2007, 05:12 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
"QmFs4XpzIEJvZPM=" is the base64 encoding of "Balázs Bodó"
 
Old 03-24-2007, 05:33 PM   #3
vargadanis
Member
 
Registered: Sep 2006
Posts: 248

Original Poster
Rep: Reputation: 30
Now, tell me pls... how did you know that?
 
Old 03-25-2007, 03:08 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
That's defined in this MIME RFC:
http://tools.ietf.org/html/rfc2047
 
Old 03-25-2007, 09:23 AM   #5
vargadanis
Member
 
Registered: Sep 2006
Posts: 248

Original Poster
Rep: Reputation: 30
God, I hate RFC! Because I have to read them! But anyways... imap_mime_headerdecode function does it for me automatically. Or at least something similar. So you know all the RFCs?
 
Old 03-25-2007, 11:11 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Of course not.

Actually, I was just strongly suspecting the string to be base-64, as it is the common way to encode localized strings with mails (that's the thing I know). I checked it was true by decoding it and found later which RFC was specifying it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lacking support for ISO-8859-1 NNP Linux - Software 2 02-07-2007 08:01 AM
Suse and ISO-8859-15 charset badbunny Linux - Newbie 2 10-21-2005 03:44 AM
emacs 21.3 and iso-8859-15 locale otoomet Linux - Software 0 11-01-2004 05:33 AM
Problem with UTF-8 and ISO-8859-1 dasenjo Linux - Software 0 06-22-2003 12:14 AM
iso 8859 or iso 9960 tsundram Linux - Newbie 16 02-22-2002 10:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration