From:
Operating system: Windows XP
PHP version: 5.3.8
Package: Unknown/Other Function
Bug Type: Bug
Bug description:utf8_decode has a problem when the crypted char à is next to
an umlaut
Description:
------------
I've user the function utf8_decode to decode the following text:
Zur Haupt- und Notentwässerung nach DIN EN 12056-3 und DIN 1986-100 und
zum vorbeugenden Brandschutz bei größeren genutzten und ungenutzten
Dachflächen
utf8_decode decodes the string with just one problem. The decode function
returns this text:
Zur Haupt- und Notentwässerung nach DIN EN 12056-3 und DIN 1986-100 und
zum vorbeugenden Brandschutz bei grö�?eren genutzten und ungenutzten
Dachflächen
the word "gröÃeren" couldn't be decoded. I've searched on google but
don't find an issue or a way to solve the problem.. then i just tried to
replace the char "Ã" with and its own code.. i've solved the problem..
$test = str_replace("ß",utf8_encode("Ã"),$test);
after this the problem is solved and the string is correctly trnaslated:
Zur Haupt- und Notentwässerung nach DIN EN 12056-3 und DIN 1986-100 und
zum vorbeugenden Brandschutz bei gröÃeren genutzten und ungenutzten
Dachflächen
I testet to place other chars like ö and ä next to each other but this
isnt a problem for the function. But each special char (ö, ä ,ü) that i
put next to an à couldn't be decoded.. is this an error or what is the
problem??
Test script:
---------------
$test = "Zur Haupt- und Notentwäüsserung nach DIN EN 12056-3 und DIN
1986-100 und zum vorbeugenden Brandschutz bei größeren genutzten und
ungenutzten Dachflächen";
echo utf8_decode($test) . "<hr/>";
// the output is:
// Zur Haupt- und Notentwäüsserung nach DIN EN 12056-3 und DIN 1986-100
und zum vorbeugenden Brandschutz bei grö�?eren genutzten und ungenutzten
Dachflächen
###################################
$test = str_replace("ß",utf8_encode("Ã"),$test);
echo utf8_decode($test);
// the output is:
// Zur Haupt- und Notentwäüsserung nach DIN EN 12056-3 und DIN 1986-100
und zum vorbeugenden Brandschutz bei gröÃeren genutzten und ungenutzten
Dachflächen
--
Edit bug report at https://bugs.php.net/bug.php?id=55621&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55621&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55621&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55621&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55621&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55621&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55621&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55621&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55621&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55621&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55621&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55621&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55621&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55621&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55621&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55621&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55621&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55621&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55621&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55621&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55621&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55621&r=mysqlcfg