diff --git a/libaegisub/common/line_iterator.cpp b/libaegisub/common/line_iterator.cpp index b288c831b6bdf9ce61864b46d7d44e0b01576ffd..21754a41c609dfc6b7f320af5b053ae5b1cdbdca 100644 --- a/libaegisub/common/line_iterator.cpp +++ b/libaegisub/common/line_iterator.cpp @@ -22,7 +22,6 @@ namespace agi { line_iterator_base::line_iterator_base(std::istream &stream, std::string encoding) : stream(&stream) { - boost::to_lower(encoding); if (encoding != "utf-8") { agi::charset::IconvWrapper c("utf-8", encoding.c_str()); c.Convert("\r", 1, reinterpret_cast<char *>(&cr), sizeof(int)); diff --git a/src/charset_detect.cpp b/src/charset_detect.cpp index 9fd27e175f495795346ab06519e41fad680739e1..aab4ef7de1203089043c015a1dbd82842f78a5a1 100644 --- a/src/charset_detect.cpp +++ b/src/charset_detect.cpp @@ -47,8 +47,11 @@ namespace CharSetDetect { std::string GetEncoding(agi::fs::path const& filename) { auto encoding = agi::charset::Detect(filename); - if (!encoding.empty()) + if (!encoding.empty()) { + if (!encoding.compare("ASCII")) + encoding = "utf-8"; return encoding; + } auto choices = agi::charset::GetEncodingsList<wxArrayString>(); int choice = wxGetSingleChoiceIndex(