diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-03-03 16:23:06 -0600 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2021-03-03 16:23:06 -0600 |
| commit | 7d20de77d2f340241b77ff35fd592d4d62d29856 (patch) | |
| tree | 22dbcdceaea1f90545f30866ee923205ce90a654 /src/text_file_functions.cpp | |
| parent | e13e6183d967d7ca7218240bae252dd7bdf3c182 (diff) | |
Fix files not being written as UTF-8
Diffstat (limited to 'src/text_file_functions.cpp')
| -rw-r--r-- | src/text_file_functions.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 4718f745..f6a5d6ce 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -176,6 +176,7 @@ bool AOApplication::write_to_file(QString p_text, QString p_file, bool make_dir) QIODevice::Truncate)) { QTextStream out(&f_log); + out.setCodec("UTF-8"); out << p_text; f_log.flush(); @@ -205,6 +206,7 @@ bool AOApplication::append_to_file(QString p_text, QString p_file, if (f_log.open(QIODevice::WriteOnly | QIODevice::Append)) { QTextStream out(&f_log); + out.setCodec("UTF-8"); out << "\r\n" << p_text; f_log.flush(); @@ -226,7 +228,7 @@ void AOApplication::write_to_serverlist_txt(QString p_line) } QTextStream out(&serverlist_txt); - + out.setCodec("UTF-8"); out << "\r\n" << p_line; serverlist_txt.close(); |
