Maybe it's me who is misunderstanding this, but isn't this string in
quoted printable:
"OLED & =?ISO-8859-1?Q?br=E4nsleceller?="
It's found in the Subject: header in a usenet message (i.e. not in a
mail) which had these headers:
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
So, ok - it isn't quoted printable, or? I've always thought that the
Content-Type header only referred to the body of the text, the subject
line still had to be in quoted-printable, which is why swedish
characters in the post body isn't garbled like above. How do I parse
it back to what it's supposed to be:
"OLED & bränsleceller"
Thanks for any help.
--
Sandman[.net] 6 4855
On Fri, 14 Jul 2006 15:48:47 +0200, Sandman <mr@sandman.netwrote:
>Maybe it's me who is misunderstanding this, but isn't this string in quoted printable:
"OLED & =?ISO-8859-1?Q?br=E4nsleceller?="
It's found in the Subject: header in a usenet message (i.e. not in a mail) which had these headers:
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
So, ok - it isn't quoted printable, or?
Not quoted-printable; see RFC 2047 - MIME (Multipurpose Internet Mail
Extensions) Part Three: Message Header Extensions for Non-ASCII Text
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
In article <2r********************************@4ax.com>,
Andy Hassall <an**@andyh.co.ukwrote:
On Fri, 14 Jul 2006 15:48:47 +0200, Sandman <mr@sandman.netwrote:
Maybe it's me who is misunderstanding this, but isn't this string in
quoted printable:
"OLED & =?ISO-8859-1?Q?br=E4nsleceller?="
It's found in the Subject: header in a usenet message (i.e. not in a
mail) which had these headers:
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
So, ok - it isn't quoted printable, or?
Not quoted-printable; see RFC 2047 - MIME (Multipurpose Internet Mail
Extensions) Part Three: Message Header Extensions for Non-ASCII Text
Aha - gotcha. Any idea on how to decode it to a 8bit string?
--
Sandman[.net]
Sandman wrote:
Maybe it's me who is misunderstanding this, but isn't this string in
quoted printable:
"OLED & =?ISO-8859-1?Q?br=E4nsleceller?="
I think the term is "quoted word." It's sort of confusing.
So, ok - it isn't quoted printable, or? I've always thought that the
Content-Type header only referred to the body of the text, the subject
line still had to be in quoted-printable, which is why swedish
characters in the post body isn't garbled like above. How do I parse
it back to what it's supposed to be:
"OLED & bränsleceller"
With regular expression, of course.
function quoted_word_callback($m) {
switch($m[2]) {
case 'Q': case 'q': return quoted_printable_decode($m[3]);
case 'B': case 'b': return base64_decode($m[3]);
}
}
echo preg_replace_callback('/=\?(.*)\?([BQ])\?(.*)\?=/U',
'quoted_word_callback', $s);
In article <11**********************@s13g2000cwa.googlegroups .com>,
"Chung Leong" <ch***********@hotmail.comwrote:
Sandman wrote:
Maybe it's me who is misunderstanding this, but isn't this string in
quoted printable:
"OLED & =?ISO-8859-1?Q?br=E4nsleceller?="
I think the term is "quoted word." It's sort of confusing.
So, ok - it isn't quoted printable, or? I've always thought that the
Content-Type header only referred to the body of the text, the subject
line still had to be in quoted-printable, which is why swedish
characters in the post body isn't garbled like above. How do I parse
it back to what it's supposed to be:
"OLED & bränsleceller"
With regular expression, of course.
function quoted_word_callback($m) {
switch($m[2]) {
case 'Q': case 'q': return quoted_printable_decode($m[3]);
case 'B': case 'b': return base64_decode($m[3]);
}
}
echo preg_replace_callback('/=\?(.*)\?([BQ])\?(.*)\?=/U',
'quoted_word_callback', $s);
It didn't work...
#!/usr/bin/php
<?
function quoted_word_callback($m) {
switch($m[2]) {
case 'Q': case 'q': return quoted_printable_decode($m[3]);
case 'B': case 'b': return base64_decode($m[3]);
}
}
$s = "OLED & =?ISO-8859-1?Q?br=E4nsleceller?=";
echo preg_replace_callback('/=\?(.*)\?([BQ])\?(.*)\?=/U',
'quoted_word_callback', $s);
?>
Result:
OLED & br”nsleceller
Instead of:
OLED & bränsleceller
--
Sandman[.net]
*** Sandman escribió/wrote (Sat, 15 Jul 2006 08:01:58 +0200):
Result:
OLED & br”nsleceller
Instead of:
OLED & bränsleceller
The code works fine for me. Just make sure that wherever you're printing
the result can handle ISO-8859-1 characters (it seems you're using it as
shell script so your console may be configured to show UTF-8).
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
In article <1i*****************************@40tude.net>,
"Alvaro G. Vicario" <we*******@NOSPAMdemogracia.comwrote:
*** Sandman escribió/wrote (Sat, 15 Jul 2006 08:01:58 +0200):
Result:
OLED & br”nsleceller
Instead of:
OLED & bränsleceller
The code works fine for me. Just make sure that wherever you're printing
the result can handle ISO-8859-1 characters (it seems you're using it as
shell script so your console may be configured to show UTF-8).
Yes! That was it - sorry about that!
--
Sandman[.net] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Daniel Alexandre |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi there,
I'm using the following method in my program to check whether a message
received is printable or not and to strip the non-printable...
|
by: Guoqi Zheng |
last post by:
Any good articles about how to write a good quoted-printable encode class in
dotnet? I found several free source code on Internet, but they do not work
correctly.
--
Kind regards
Guoqi Zheng...
|
by: Guoqi Zheng |
last post by:
Any good articles about how to write a good quoted-printable encode class in
dotnet? I found several free source code on Internet, but do not work
correctly.
--
Kind regards
Guoqi Zheng...
|
by: Lucas Tam |
last post by:
Is there a way to change System.Web.Mail's Content Transfer Encoding? It's
currently using Quoted Printable... However, a piece of software on the
receiving end does not support Quoted Printable.
...
|
by: ywchan |
last post by:
i use pop3 with .NET to retrieve email
it works fine for english only...if the message contains chinese,
the chinese characters sometimes display as base64 (e.g.
=?big5?B?jkfajfdfjkk==?= ) /...
|
by: =?Utf-8?B?RGljaw==?= |
last post by:
I've successfully used System.Convert.ToBase64String to convert my files to
Base64.
Now I want to do the same for Quoted-Printable but I can’t see how that to
achieve this.
Can it be done?
|
by: active |
last post by:
I want to remove all non-printable characters - including nulls.
I could extend the following by adding as many printable characters as I can
think of.
But I wonder if there isn't something...
|
by: Claudia Fong |
last post by:
Hi,
I have a windows application and I want to simulate the send email
function. Is it possible?
How?
Ca someone tell me?
Cheers!
|
by: Chris K. |
last post by:
Hello,
I am currently working on a project that requires processing
quoted-printable messages and I didn't find anything built into the
framework that offers the encoder/decoder. Is there any...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |