fix usages of iconv
This commit is contained in:
parent
d1c7b27563
commit
70d15cc0ec
@ -81,7 +81,7 @@ class Processor implements DocumentProcessorInterface
|
|||||||
$url = trim($url);
|
$url = trim($url);
|
||||||
$url = preg_replace('~[^\\pL0-9_]+~u', '-', $url);
|
$url = preg_replace('~[^\\pL0-9_]+~u', '-', $url);
|
||||||
$url = trim($url, "-");
|
$url = trim($url, "-");
|
||||||
$url = iconv("utf-8", "us-ascii//TRANSLIT", $url);
|
$url = iconv("utf-8", "ASCII//TRANSLIT//IGNORE", $url);
|
||||||
$url = preg_replace('~[^-a-zA-Z0-9_]+~', '', $url);
|
$url = preg_replace('~[^-a-zA-Z0-9_]+~', '', $url);
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
@ -154,9 +154,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator
|
|||||||
|
|
||||||
// Sometimes strings are detected as invalid UTF-8 and json_encode can't treat them
|
// Sometimes strings are detected as invalid UTF-8 and json_encode can't treat them
|
||||||
// iconv can fix those strings
|
// iconv can fix those strings
|
||||||
if (function_exists("iconv")) {
|
|
||||||
$text = iconv('UTF-8', 'UTF-8//IGNORE', $text);
|
$text = iconv('UTF-8', 'UTF-8//IGNORE', $text);
|
||||||
}
|
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user