From c913b2f52c3a26d37914ef364ec6d7274fc7efef Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 17 Aug 2009 21:01:22 +0200 Subject: [PATCH] Initialize the global charset converter with a dummy so that text output with mxmsg() works before the locale is initialized. --- src/common/locale.cpp | 3 +++ src/common/locale.h | 1 + src/common/output.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/locale.cpp b/src/common/locale.cpp index da7e9fd2c..dee9b7b81 100644 --- a/src/common/locale.cpp +++ b/src/common/locale.cpp @@ -44,6 +44,9 @@ charset_converter_cptr g_cc_local_utf8; std::map charset_converter_c::s_converters; +charset_converter_c::charset_converter_c() { +} + charset_converter_c::charset_converter_c(const std::string &charset) : m_charset(charset) { diff --git a/src/common/locale.h b/src/common/locale.h index ff55f6dc6..9f65a5120 100644 --- a/src/common/locale.h +++ b/src/common/locale.h @@ -34,6 +34,7 @@ protected: std::string m_charset; public: + charset_converter_c(); charset_converter_c(const std::string &charset); virtual ~charset_converter_c(); diff --git a/src/common/output.cpp b/src/common/output.cpp index 852788896..6f5fc3cf8 100644 --- a/src/common/output.cpp +++ b/src/common/output.cpp @@ -36,8 +36,8 @@ bool g_warning_issued = false; std::string g_stdio_charset; static bool s_mm_stdio_redirected = false; -charset_converter_cptr g_cc_stdio; -counted_ptr g_mm_stdio = counted_ptr(new mm_stdio_c()); +charset_converter_cptr g_cc_stdio = charset_converter_cptr(new charset_converter_c); +counted_ptr g_mm_stdio = counted_ptr(new mm_stdio_c); void redirect_stdio(mm_io_c *stdio) {