Check for pixiv.net specifically, fuck this.
This commit is contained in:
parent
842e91a413
commit
d90e1e1c0b
1 changed files with 5 additions and 3 deletions
|
@ -125,10 +125,12 @@ final class WebLookup implements \Uiharu\ILookup {
|
||||||
self::reqClose($req);
|
self::reqClose($req);
|
||||||
|
|
||||||
$charSet = $mediaType->getCharset();
|
$charSet = $mediaType->getCharset();
|
||||||
$charSetWrangle = function(string $input) use ($charSet): string {
|
$urlHost = $url->getHost();
|
||||||
if(strtoupper($charSet) === 'UTF-8') {
|
$charSetWrangle = function(string $input) use ($charSet, $urlHost): string {
|
||||||
|
// fuck it
|
||||||
|
if($urlHost === 'pixiv.net' || $urlHost === 'www.pixiv.net') {
|
||||||
$decoded = mb_convert_encoding($input, 'ISO-8859-1', 'UTF-8');
|
$decoded = mb_convert_encoding($input, 'ISO-8859-1', 'UTF-8');
|
||||||
if(mb_check_encoding($decoded, 'UTF-8'))
|
if(mb_check_encoding($decoded, 'UTF-8') && str_repeat('?', strlen($decoded)) !== $decoded)
|
||||||
return $decoded;
|
return $decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue