Skip to content
Snippets Groups Projects
Commit eddeaca7 authored by Andrew Rudenets's avatar Andrew Rudenets
Browse files

fix

parent a5b4893b
Branches
Tags
No related merge requests found
......@@ -110,10 +110,10 @@ class FileParser
public static function toUTF8($source_str) {
// TODO: make it able to convert from any encoding to UTF-8
$enc = mb_detect_encoding($source_str, mb_list_encodings(), true);
if ($enc === false)
return $source_str;
else if ($enc !== "UTF-8")
if ($enc === "ISO-8859-1" || !$enc)
return mb_convert_encoding($source_str, "utf-8", "windows-1251");
else if ($enc !== "UTF-8")
return mb_convert_encoding($source_str, "utf-8", $enc);
else
return $source_str;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment