jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / library / glibmm-268 / patches / glib_glibmm_ustring.cc.patch
blobc9d5b5db174f6bb2c254f882d08236c89ece47e1
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
7 @@ -1373,7 +1373,7 @@
8 #else
9 gsize n_bytes = 0;
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 */
16 @@ -1462,7 +1462,7 @@
17 #else
18 gsize n_bytes = 0;
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)
24 if (error)
25 @@ -1490,7 +1490,7 @@
26 g_utf8_to_utf16(utf8_string.raw().data(), utf8_string.raw().size(), nullptr, nullptr, &error));
27 #else
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)
33 if (error)
34 --- glibmm-2.82.0/untracked/glib/glibmm/convert.cc.orig
35 +++ glibmm-2.82.0/untracked/glib/glibmm/convert.cc
36 @@ -319,7 +319,7 @@
37 #else
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)
45 @@ -351,7 +351,7 @@
46 gsize n_bytes = 0;
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)