#32497 [Opn]: Quotes from iso-8859-1 get converted incorrectly
| From: | mschering at intermesh dot nl | Date: | Wed, 30 Mar 2005 08:22:15 +0000 |
| Subject: | #32497 [Opn]: Quotes from iso-8859-1 get converted incorrectly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-76041@lists.php.net to get a copy of this message | ||
ID: 32497
User updated by: mschering at intermesh dot nl
Reported By: mschering at intermesh dot nl
Status: Open
Bug Type: ICONV related
Operating System: Linux 2.6
PHP Version: 4.3.10
New Comment:
Here's the source of the message part that contains these characters:
------=_NextPart_001_010A_01C53499.35C327F0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><B=20
style=3D"mso-bidi-font-weight: normal"><SPAN lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><?xml:namespace prefix
=3D =
o ns =3D=20
"urn:schemas-microsoft-com:office:office" =
/><o:p>Ola!</o:p></SPAN></B></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><B=20
style=3D"mso-bidi-font-weight: normal"><SPAN lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><o:p></o:p></SPAN></B> </P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><STRONG>Mark en
=
Martijn=20
geven een vette fiesta en JIJ bent uitgenodigd! Doe je dansschoenen
aan, =
want de=20
sfeer is Latijns-Amerikaans... Dat betekent Salsa, Merengue en Mambo!
En =
natuurlijk vele cerveza=92s en andere lekkere=20
drankjes!<o:p></o:p></STRONG></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><STRONG>Wij
gaan =
2,5 maand=20
vakantie vieren in Mexico, Belize, Guatemala, Honduras, Nicaragua,
Costa =
Rica,=20
Panama, Equador, Chili, Peru en Bolivia, dus beschouw deze avond maar
=
als een=20
(voorlopig) laatste feestje in =
Nederland=85<o:p></o:p></STRONG></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><STRONG>We =
hebben trouwens=20
ook al de nodige publiciteit gehad over dit feest! Check maar eens in
de =
bijlage=20
het artikel dat afgelopen zaterdag in de Telegraaf =
stond=85</STRONG></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG><o:p></o:p></STRONG></SPAN> </P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG>Datum:</STRONG> 16=20
april 2005<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG>Locatie:</STRONG> Caf=E9=20
De Deugniet<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY:
Arial">Verwerstraat=20
55<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">5211 HT=20
=92s-Hertogenbosch<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG>Aanvang: </STRONG>21:00=20
uur<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG>Kledingtip:</STRONG> Zuid-Amerikaans=20
(Braziliaanse bikini en sombrero)<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DEN-GB=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: =
EN-GB"><STRONG>Kado-tip:</STRONG> Dollars=20
of Euros<o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DEN-GB=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: =
EN-GB"><STRONG>Routebeschrijving:</STRONG> Check=20
</SPAN><SPAN lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY:
Arial"><A=20
href=3D"http://www.anwb.nl/"><SPAN
lang=3DEN-GB=20
style=3D"mso-ansi-language:
EN-GB">www.anwb.nl</SPAN></A></SPAN><SPAN
=
lang=3DEN-GB=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: =
EN-GB">,=20
</SPAN><SPAN lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY:
Arial"><A=20
href=3D"http://www.routenet.nl/"><SPAN
lang=3DEN-GB=20
style=3D"mso-ansi-language: =
EN-GB">www.routenet.nl</SPAN></A></SPAN><SPAN=20
lang=3DEN-GB=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language:
EN-GB"> =
of=20
</SPAN><SPAN lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY:
Arial"><A=20
href=3D"http://www.map24.com/"><SPAN
lang=3DEN-GB=20
style=3D"mso-ansi-language:
EN-GB">www.map24.com</SPAN></A></SPAN><SPAN
=
lang=3DEN-GB=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: =
EN-GB"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><STRONG>Er is
=
voldoende=20
parkeergelegenheid!<o:p></o:p></STRONG></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG></STRONG></SPAN> </P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><STRONG>Laat
ons =
svp weten=20
via </STRONG><A=20
href=3D"mailto:mark@webweavers.nl"><STRONG>mark@webweavers.nl</STRONG></A=
><STRONG>=20
of </STRONG><A=20
href=3D"mailto:martijn@nicebite.nl"><STRONG>nicebite@home.nl</STRONG></A>=
<STRONG>=20
of je wel of niet komt i.v.m. de =
planning.<o:p></o:p></STRONG></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG></STRONG></SPAN> </P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><STRONG>Adi=F3s! <o:p></o:p></STRONG></SPAN></P>
<P class=3DMsoNormal=20
style=3D"MARGIN: 0cm 0cm 0pt; mso-margin-top-alt: auto; =
mso-margin-bottom-alt: auto"><SPAN=20
lang=3DNL style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><STRONG>Mark =
&=20
Martijn<o:p></o:p></STRONG></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN> </P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">P. S. Tijdens onze trip
=
zullen we=20
een website bijhouden: <A=20
href=3D"http://trip.webweavers.nl/">http://trip.webweavers.nl/</A><o:p></=
o:p></SPAN></P>
<P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DNL=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Op deze site komen =
foto=92s te staan=20
en verhalen over onze reis en er is ook een gastenboek. Als je je =
registreert=20
onder =93sign up=94 (links in het menu) kunnen we je af en toe een mail
=
sturen om je=20
te waarschuwen wanneer er weer nieuwe verhalen te lezen zijn.=20
</SPAN></P></DIV></FONT></DIV></BODY></HTML>
Previous Comments:
------------------------------------------------------------------------
[2005-03-30 10:07:45] mschering at intermesh dot nl
I discovered that the following ascii characters go bad with iconv
(Maybe more but these I found).
133, 146, 147, 148
I now workaround like this:
$str = str_replace(chr(133), ".", $str);
$str = str_replace(chr(146), "'", $str);
$str = str_replace(chr(147), '"', $str);
$str = str_replace(chr(148), '"', $str);
------------------------------------------------------------------------
[2005-03-30 08:58:29] mschering at intermesh dot nl
Description:
------------
When I convert an iso-8859-1 text that contains quotes (The mail
message I tested was composed with Microsoft Outlook Express
6.00.2600.0000) They get converted to an character that displays as a
cubic character so it doesn't exists.
Don't know if it's relevant but before using quoted_printable_decode()
one of the characters that is diplayed wrong is written as =92
Reproduce code:
---------------
Compose a mail message with outlook express in iso-8859-1 encoding and
put some ' and " in it. Convert that with iconv and you'll see
unexpected results.
Expected result:
----------------
I expect the text to be the same as when I view it in iso-8859-1
encoding.
Actual result:
--------------
Strange characters in the converted text.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32497&edit=1