diff --git a/0001-file-name-cloud-be-UTF-8.patch b/0001-file-name-cloud-be-UTF-8.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6b293cc4a63e1859b679e0466953ce6118c405e --- /dev/null +++ b/0001-file-name-cloud-be-UTF-8.patch @@ -0,0 +1,40 @@ +From e4fef16537e99141de1763368d03c98456a17a00 Mon Sep 17 00:00:00 2001 +From: Liwei Ge +Date: Thu, 4 Jul 2024 21:16:47 +0800 +Subject: [PATCH] file name cloud be UTF-8 + +--- + glib/goption.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/glib/goption.c b/glib/goption.c +index 0b3a05e..7af7770 100644 +--- a/glib/goption.c ++++ b/glib/goption.c +@@ -1287,7 +1287,10 @@ parse_arg (GOptionContext *context, + else + data = g_strdup (value); + #else +- data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ if (!g_utf8_validate (value, -1, NULL)) ++ data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ else ++ data = g_strdup (value); + #endif + + if (!data) +@@ -1316,7 +1319,10 @@ parse_arg (GOptionContext *context, + else + data = g_strdup (value); + #else +- data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ if (!g_utf8_validate (value, -1, NULL)) ++ data = g_locale_to_utf8 (value, -1, NULL, NULL, error); ++ else ++ data = g_strdup (value); + #endif + + if (!data) +-- +2.39.3 + diff --git a/glib2.spec b/glib2.spec index 797a356e15dbaaa990c99496056c970d4a73fd28..a3c0e6e768783778d6abe93397828668323fbfad 100644 --- a/glib2.spec +++ b/glib2.spec @@ -1,6 +1,7 @@ +%define anolis_release .0.1 Name: glib2 Version: 2.68.4 -Release: 14%{?dist} +Release: 14%{anolis_release}%{?dist} Summary: A library of handy utility functions License: LGPLv2+ @@ -54,6 +55,8 @@ Patch14: 3353.patch # https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3845 Patch15: 3845.patch +Patch1000: 0001-file-name-cloud-be-UTF-8.patch + BuildRequires: chrpath BuildRequires: gcc BuildRequires: gcc-c++ @@ -273,6 +276,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/installed-tests %changelog +* Mon Jul 15 2024 Liwei Ge - 2.68.4-14.0.1 +- file name cloud be UTF-8 + * Wed Feb 21 2024 Michael Catanzaro - 2.68.4-14 - Rebuild against newer util-linux for libmnt changes - Resolves: RHEL-23637