Bug #55621 [NEW]: utf8_decode has a problem when the crypted char ß is next to an umlaut

From: Date: Tue, 06 Sep 2011 12:53:14 +0000
Subject: Bug #55621 [NEW]: utf8_decode has a problem when the crypted char ß is next to an umlaut
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163330@lists.php.net to get a copy of this message
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

« previous php.bugs (#163330) next »