FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=12916&edit=1

ID: 12916
Updated by: daniel.oconnor@gmail.com
Reported By: ulrich-fischer at gmx dot net
Summary: German umlauts are displayed wrong
Status: Analyzed
Type: Bug
Package: XML_Feed_Parser
Package Version: 1.0.2
PHP Version: 5.2.3
Roadmap Versions:
New Comment:

clockwerx@clockwerx-desktop:~/XML_Feed_Parser$ patch -p1 < patch-
download.php\?id\=12916\&patch\=entities\&revision\=1229367624
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
--- Type.php 2008-12-15 13:16:57.000000000 -0500
+++ /usr/local/php5/lib/php/XML/Feed/Parser/Type.php 2008-12-15
13:17:22.000000000 -0500
--------------------------
File to patch: XML/Feed/Parser/Type.php
patching file XML/Feed/Parser/Type.php
Hunk #1 FAILED at 333.
1 out of 1 hunk FAILED -- saving rejects to file
XML/Feed/Parser/Type.php.rej


Previous Comments:
------------------------------------------------------------------------

[2009-05-23 19:59:34] doconnor

-Status: Open
+Status: Analyzed


------------------------------------------------------------------------

[2009-05-23 19:59:23] doconnor

Thanks for the patch Michael!

Given my unfamiliarity with the package, I've only had a cursory glance,
and it LGTM.

I don't suppose anyone in this thread would be interested in adopting
this package?

------------------------------------------------------------------------

[2008-12-15 14:03:25] herringm

In content elements of type 'xhtml', Type.php defines
processEntitiesForNodeValue() which is used to take care of entities
within these 'xhtml' type elements only (it is NOT used for text or any
other types). This function doesn't work properly because it calls
iconv or utf8_encode on the input string (provided it is not UTF-8 to
begin with) and then handles entitized characters with
html_entity_decode() and htmlentities().

This has been fixed by handling entitized characters with
html_entity_decode() and htmlentities() prior to the iconv or
utf8_encode on the input string.

The encoding of the final rendered page must also be utf-8 for these
characters to be properly displayed.

------------------------------------------------------------------------

[2008-06-12 07:55:55] mortencb

I have temporarily fixed it for our norwegian characters (and some
others) by doing this on the output text:

function norskeTegn($gurba) {
$gurba = str_replace("Ã&#166;","æ",$gurba);
$gurba = str_replace("Ã&#184;","ø",$gurba);
$gurba = str_replace("Ã¥","å",$gurba);
$gurba = str_replace("Ã\206","Æ",$gurba);
$gurba = str_replace("Ã\230","Ø",$gurba);
$gurba = str_replace("Ã\205","Å",$gurba);
$gurba = str_replace("â\200\223","-",$gurba);
$gurba = str_replace("ö","ö",$gurba);
$gurba = str_replace("«","«",$gurba);
$gurba = str_replace("»","»",$gurba);
return $gurba;
}

------------------------------------------------------------------------

[2008-06-03 11:36:06] jystewart

I've continued to work on this as time allows but have yet to come up
with a solution that doesn't introduce regressions. The solution
proposed in this thread is causing bugs in some of the other handling.

My time to work on this is very limited, so if anyone has any patches to
offer then that would definitely speed things up.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=12916

Search Discussions

  • Daniel Oconnor at Dec 9, 2011 at 11:52 am
    Edit report at https://pear.php.net/bugs/bug.php?id=12916&edit=1

    ID: 12916
    Updated by: daniel.oconnor@gmail.com
    Reported By: ulrich-fischer at gmx dot net
    Summary: German umlauts are displayed wrong
    Status: Analyzed
    Type: Bug
    Package: XML_Feed_Parser
    Package Version: 1.0.2
    PHP Version: 5.2.3
    Roadmap Versions:
    New Comment:

    http://test.pear.php.net:8080/job/XML_Feed_Parser/40/testReport/junit/(root)/R
    egressions/test_handlesGermanUmlauts/

    After applying your fixes; I think


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-12-09 10:50:57] doconnor

    clockwerx@clockwerx-desktop:~/XML_Feed_Parser$ patch -p1 < patch-
    download.php\?id\=12916\&patch\=entities\&revision\=1229367624
    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    --- Type.php 2008-12-15 13:16:57.000000000 -0500
    +++ /usr/local/php5/lib/php/XML/Feed/Parser/Type.php 2008-12-15
    13:17:22.000000000 -0500
    --------------------------
    File to patch: XML/Feed/Parser/Type.php
    patching file XML/Feed/Parser/Type.php
    Hunk #1 FAILED at 333.
    1 out of 1 hunk FAILED -- saving rejects to file
    XML/Feed/Parser/Type.php.rej

    ------------------------------------------------------------------------

    [2009-05-23 19:59:34] doconnor

    -Status: Open
    +Status: Analyzed


    ------------------------------------------------------------------------

    [2009-05-23 19:59:23] doconnor

    Thanks for the patch Michael!

    Given my unfamiliarity with the package, I've only had a cursory glance,
    and it LGTM.

    I don't suppose anyone in this thread would be interested in adopting
    this package?

    ------------------------------------------------------------------------

    [2008-12-15 14:03:25] herringm

    In content elements of type 'xhtml', Type.php defines
    processEntitiesForNodeValue() which is used to take care of entities
    within these 'xhtml' type elements only (it is NOT used for text or any
    other types). This function doesn't work properly because it calls
    iconv or utf8_encode on the input string (provided it is not UTF-8 to
    begin with) and then handles entitized characters with
    html_entity_decode() and htmlentities().

    This has been fixed by handling entitized characters with
    html_entity_decode() and htmlentities() prior to the iconv or
    utf8_encode on the input string.

    The encoding of the final rendered page must also be utf-8 for these
    characters to be properly displayed.

    ------------------------------------------------------------------------

    [2008-06-12 07:55:55] mortencb

    I have temporarily fixed it for our norwegian characters (and some
    others) by doing this on the output text:

    function norskeTegn($gurba) {
    $gurba = str_replace("Ã&#166;","æ",$gurba);
    $gurba = str_replace("Ã&#184;","ø",$gurba);
    $gurba = str_replace("Ã¥","å",$gurba);
    $gurba = str_replace("Ã\206","Æ",$gurba);
    $gurba = str_replace("Ã\230","Ø",$gurba);
    $gurba = str_replace("Ã\205","Å",$gurba);
    $gurba = str_replace("â\200\223","-",$gurba);
    $gurba = str_replace("ö","ö",$gurba);
    $gurba = str_replace("«","«",$gurba);
    $gurba = str_replace("»","»",$gurba);
    return $gurba;
    }

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=12916
  • Daniel Oconnor at Dec 9, 2011 at 12:01 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=12916&edit=1

    ID: 12916
    Updated by: daniel.oconnor@gmail.com
    Reported By: ulrich-fischer at gmx dot net
    Summary: German umlauts are displayed wrong
    Status: Analyzed
    Type: Bug
    Package: XML_Feed_Parser
    Package Version: 1.0.2
    PHP Version: 5.2.3
    Roadmap Versions:
    New Comment:

    Scratch that; no changes since at least build 16 in behaviour - so your
    patch
    didn't cause that test to fail


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-12-09 12:52:22] doconnor

    http://test.pear.php.net:8080/job/XML_Feed_Parser/40/testReport/junit/(root)/R
    egressions/test_handlesGermanUmlauts/

    After applying your fixes; I think

    ------------------------------------------------------------------------

    [2011-12-09 10:50:57] doconnor

    clockwerx@clockwerx-desktop:~/XML_Feed_Parser$ patch -p1 < patch-
    download.php\?id\=12916\&patch\=entities\&revision\=1229367624
    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    --- Type.php 2008-12-15 13:16:57.000000000 -0500
    +++ /usr/local/php5/lib/php/XML/Feed/Parser/Type.php 2008-12-15
    13:17:22.000000000 -0500
    --------------------------
    File to patch: XML/Feed/Parser/Type.php
    patching file XML/Feed/Parser/Type.php
    Hunk #1 FAILED at 333.
    1 out of 1 hunk FAILED -- saving rejects to file
    XML/Feed/Parser/Type.php.rej

    ------------------------------------------------------------------------

    [2009-05-23 19:59:34] doconnor

    -Status: Open
    +Status: Analyzed


    ------------------------------------------------------------------------

    [2009-05-23 19:59:23] doconnor

    Thanks for the patch Michael!

    Given my unfamiliarity with the package, I've only had a cursory glance,
    and it LGTM.

    I don't suppose anyone in this thread would be interested in adopting
    this package?

    ------------------------------------------------------------------------

    [2008-12-15 14:03:25] herringm

    In content elements of type 'xhtml', Type.php defines
    processEntitiesForNodeValue() which is used to take care of entities
    within these 'xhtml' type elements only (it is NOT used for text or any
    other types). This function doesn't work properly because it calls
    iconv or utf8_encode on the input string (provided it is not UTF-8 to
    begin with) and then handles entitized characters with
    html_entity_decode() and htmlentities().

    This has been fixed by handling entitized characters with
    html_entity_decode() and htmlentities() prior to the iconv or
    utf8_encode on the input string.

    The encoding of the final rendered page must also be utf-8 for these
    characters to be properly displayed.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=12916
  • Daniel Oconnor at Dec 9, 2011 at 1:31 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=12916&edit=1

    ID: 12916
    Updated by: daniel.oconnor@gmail.com
    Reported By: ulrich-fischer at gmx dot net
    Summary: German umlauts are displayed wrong
    Status: Analyzed
    Type: Bug
    Package: XML_Feed_Parser
    Package Version: 1.0.2
    PHP Version: 5.2.3
    Roadmap Versions:
    New Comment:

    (also may not have fixed anything!)


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-12-09 13:01:11] doconnor

    Scratch that; no changes since at least build 16 in behaviour - so your
    patch
    didn't cause that test to fail

    ------------------------------------------------------------------------

    [2011-12-09 12:52:22] doconnor

    http://test.pear.php.net:8080/job/XML_Feed_Parser/40/testReport/junit/(root)/R
    egressions/test_handlesGermanUmlauts/

    After applying your fixes; I think

    ------------------------------------------------------------------------

    [2011-12-09 10:50:57] doconnor

    clockwerx@clockwerx-desktop:~/XML_Feed_Parser$ patch -p1 < patch-
    download.php\?id\=12916\&patch\=entities\&revision\=1229367624
    can't find file to patch at input line 3
    Perhaps you used the wrong -p or --strip option?
    The text leading up to this was:
    --------------------------
    --- Type.php 2008-12-15 13:16:57.000000000 -0500
    +++ /usr/local/php5/lib/php/XML/Feed/Parser/Type.php 2008-12-15
    13:17:22.000000000 -0500
    --------------------------
    File to patch: XML/Feed/Parser/Type.php
    patching file XML/Feed/Parser/Type.php
    Hunk #1 FAILED at 333.
    1 out of 1 hunk FAILED -- saving rejects to file
    XML/Feed/Parser/Type.php.rej

    ------------------------------------------------------------------------

    [2009-05-23 19:59:34] doconnor

    -Status: Open
    +Status: Analyzed


    ------------------------------------------------------------------------

    [2009-05-23 19:59:23] doconnor

    Thanks for the patch Michael!

    Given my unfamiliarity with the package, I've only had a cursory glance,
    and it LGTM.

    I don't suppose anyone in this thread would be interested in adopting
    this package?

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=12916

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 9, '11 at 9:51a
activeDec 9, '11 at 1:31p
posts4
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 4 posts

People

Translate

site design / logo © 2022 Grokbase