Open vagh opened 6 months ago
Russian too
Tried to fix Minifier.php, but all text converted at symbols like "\К\а\р\т\и\н\к\и"
@static::$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NODEFDTD | LIBXML_SCHEMA_CREATE);
Tried to fix Minifier.php, but all text converted at symbols like "Картинки"
@static::$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NODEFDTD | LIBXML_SCHEMA_CREATE);
Russian you can fix by changing two methods handle and loadDom in Minifier.php
protected function loadDom(string $html, bool $force = false)
{
if (static::$dom instanceof DOMDocument) {
if ($force) {
} else {
return;
}
}
static::$dom = new DOMDocument();
static::$dom->encoding = 'UTF-8';
@static::$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NODEFDTD | LIBXML_SCHEMA_CREATE);
}
public function handle(Request $request, Closure $next)
{
$response = $next($request);
if (!$this->shouldProcessMinify($request, $response)) {
if (!(static::$dom instanceof DOMDocument)) {
return $response;
}
}
$html = $response->getContent();
$html = self::replaceDirectives($html);
$this->loadDom($html);
$minifiedHtml = $this->apply();
$minifiedHtml = html_entity_decode($minifiedHtml, ENT_QUOTES | ENT_HTML5, 'UTF-8');
return $response->setContent($minifiedHtml);
}
Hello, this package doesn't seem to support Chinese compression.