German umlauts are converted incorrectly with "toAscii" (webalize) method
Zrnik opened this issue · comments
Štěpán Zrník commented
Version: i think every version
Bug Description
Method toAscii
(and thus webalize
) is incorrectly converting german umlauts.
Reproduce
<?php declare(strict_types=1);
include __DIR__ . '/src/Utils/StaticClass.php';
include __DIR__ . '/src/Utils/Callback.php';
include __DIR__ . '/src/Utils/Strings.php';
$ok = "✔️";
$err = "❌";
$CorrectConversions = [
"Jägermeister" => "jaegermeister",
"Würth" => "wuerth",
"Löwenbräu" => "loewenbraeu",
"Straße" => "strasse"
];
foreach ($CorrectConversions as $toConvert => $correctConversion) {
$converted = \Nette\Utils\Strings::webalize($toConvert);
$isCorrect = $converted === $correctConversion;
echo $toConvert . " (".$correctConversion.") => " . ($isCorrect ? $ok : $err) . " " . $converted . PHP_EOL;
}
Result:
Jägermeister (jaegermeister) => ❌ jagermeister
Würth (wuerth) => ❌ wurth
Löwenbräu (loewenbraeu) => ❌ lowenbrau
Straße (strasse) => ✔️ strasse
Expected Behavior
Jägermeister (jaegermeister) => ✔️ jaegermeister
Würth (wuerth) => ✔️ wuerth
Löwenbräu (loewenbraeu) => ✔️ loewenbraeu
Straße (strasse) => ✔️ strasse
Štěpán Zrník commented
❤️