diff --git a/src/charset_detect.cpp b/src/charset_detect.cpp
index aab4ef7de1203089043c015a1dbd82842f78a5a1..0ece3b6dd3296fdd213998ac0a1e1692cc655fed 100644
--- a/src/charset_detect.cpp
+++ b/src/charset_detect.cpp
@@ -48,7 +48,7 @@ namespace CharSetDetect {
 std::string GetEncoding(agi::fs::path const& filename) {
 	auto encoding = agi::charset::Detect(filename);
 	if (!encoding.empty()) {
-		if (!encoding.compare("ASCII"))
+		if (!encoding.compare("ASCII") || !encoding.compare("UTF-8"))
 			encoding = "utf-8";
 		return encoding;
 	}