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

 ID:                 55621
 Updated by:         cataphr...@php.net
 Reported by:        mike at mike-systems dot de
 Summary:            utf8_decode has a problem when the crypted char ß
                     is next to an umlaut
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Windows XP
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Can't reproduce:

php -r "echo bin2hex(utf8_decode('größeren'));"
6772f6df6572656e

ö is encoded as 0xF6 and ß as 0xDF, as expected.

Closing as bogus.


Previous Comments:
------------------------------------------------------------------------
[2011-09-06 12:53:14] mike at mike-systems dot de

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 this bug report at https://bugs.php.net/bug.php?id=55621&edit=1

Reply via email to