From 06367d5cd9f0dd7bc8a9842fb3a56094919f4ece Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Thu, 10 Jul 2014 20:39:24 -0700
Subject: [PATCH] Don't convert encoding names to lowercase when writing files

Not only is it unnecessary, but it actively breaks the mapping of
user-friendly encoding names in the Export dialog to the real encoding
names.

Closes #1789.
---
 src/text_file_writer.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/text_file_writer.cpp b/src/text_file_writer.cpp
index 328c30cb0..c4de4c077 100644
--- a/src/text_file_writer.cpp
+++ b/src/text_file_writer.cpp
@@ -34,8 +34,7 @@ TextFileWriter::TextFileWriter(agi::fs::path const& filename, std::string encodi
 {
 	if (encoding.empty())
 		encoding = OPT_GET("App/Save Charset")->GetString();
-	boost::to_lower(encoding);
-	if (encoding != "utf-8") {
+	if (encoding != "utf-8" && encoding != "UTF-8") {
 		conv = agi::make_unique<agi::charset::IconvWrapper>("utf-8", encoding.c_str(), true);
 		newline = conv->Convert(newline);
 	}
-- 
GitLab