1 OI (and Solaris) iconv doesn't support WCHAR_T <-> UTF-8 conversions
2 ( https://www.illumos.org/issues/5089 ). But internal encoding used
3 in WCHAR_T is UCS-4LE, so we use it.
5 --- glibmm-2.82.0/glib/glibmm/ustring.cc.orig
6 +++ glibmm-2.82.0/glib/glibmm/ustring.cc
10 const auto buf = make_unique_ptr_gfree(g_convert(reinterpret_cast<const char*>(str.data()),
11 - str.size() * sizeof(std::wstring::value_type), "UTF-8", "WCHAR_T", nullptr, &n_bytes, &error));
12 + str.size() * sizeof(std::wstring::value_type), "UTF-8", "UCS-4LE", nullptr, &n_bytes, &error));
13 #endif /* !(__STDC_ISO_10646__ || G_OS_WIN32) */
15 #else /* !GLIBMM_HAVE_WIDE_STREAM */
19 const auto buf = make_unique_ptr_gfree(g_convert(reinterpret_cast<const char*>(wstr.data()),
20 - wstr.size() * sizeof(std::wstring::value_type), "UTF-8", "WCHAR_T", nullptr, &n_bytes, &error));
21 + wstr.size() * sizeof(std::wstring::value_type), "UTF-8", "UCS-4LE", nullptr, &n_bytes, &error));
22 #endif // !(__STDC_ISO_10646__ || G_OS_WIN32)
26 g_utf8_to_utf16(utf8_string.raw().data(), utf8_string.raw().size(), nullptr, nullptr, &error));
28 const auto buf = make_unique_ptr_gfree(g_convert(utf8_string.raw().data(),
29 - utf8_string.raw().size(), "WCHAR_T", "UTF-8", nullptr, nullptr, &error));
30 + utf8_string.raw().size(), "UCS-4LE", "UTF-8", nullptr, nullptr, &error));
31 #endif // !(__STDC_ISO_10646__ || G_OS_WIN32)
34 --- glibmm-2.82.0/untracked/glib/glibmm/convert.cc.orig
35 +++ glibmm-2.82.0/untracked/glib/glibmm/convert.cc
38 gsize bytes_written = 0;
39 const auto buf = make_unique_ptr_gfree(g_convert(utf8_string.c_str(),
40 - utf8_string.bytes(), "WCHAR_T", "UTF-8", nullptr, &bytes_written, &error));
41 + utf8_string.bytes(), "UCS-4LE", "UTF-8", nullptr, &bytes_written, &error));
42 items_written = bytes_written / GLIBMM_SIZEOF_WCHAR_T;
43 #endif // !(__STDC_ISO_10646__ || G_OS_WIN32)
47 const auto buf = make_unique_ptr_gfree(g_convert(
48 reinterpret_cast<const char*>(wide_string.c_str()),
49 - wide_string.size() * GLIBMM_SIZEOF_WCHAR_T, "UTF-8", "WCHAR_T",
50 + wide_string.size() * GLIBMM_SIZEOF_WCHAR_T, "UTF-8", "UCS-4LE",
51 nullptr, &n_bytes, &error));
52 bytes_written = n_bytes;
53 #endif // !(__STDC_ISO_10646__ || G_OS_WIN32)