fix(engrampa):Fix decompress files with garbled characters under GB18030 encoding

(cherry picked from commit 1737ae6cb6cb72adb18ba587d919ef26cd92f6f0)
This commit is contained in:
longcheng 2023-07-20 14:05:42 +08:00 committed by openeuler-sync-bot
parent 522031b52f
commit c9cd23f56e
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From d4d99cd0b2791452e58242373c584c8eeebac2c4 Mon Sep 17 00:00:00 2001
From: niko_yhc <yinhongchang@kylinsec.com.cn>
Date: Thu, 29 Jun 2023 09:23:48 +0800
Subject: [PATCH] fix(engrampa):Fix decompress files with garbled characters
under GB18030 encoding
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复在GB18030编码下解压文件乱码
Fixes #7672
---
src/fr-window.c | 1 +
src/main.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/fr-window.c b/src/fr-window.c
index 080e06a..f7c50f7 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -2012,6 +2012,7 @@ fr_window_update_title (FrWindow *window)
char *name;
name = g_uri_display_basename (fr_window_get_archive_uri (window));
+ name = g_locale_to_utf8(name, -1, NULL, NULL, NULL);
title = g_strdup_printf ("%s %s",
name,
window->archive->read_only ? _("[read only]") : "");
diff --git a/src/main.c b/src/main.c
index a9e297d..ba45cbf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -223,7 +223,8 @@ prepare_app (void)
char *uri;
window = fr_window_new ();
-
+
+ filename = g_locale_from_utf8(filename, -1, NULL, NULL, NULL);
file = g_file_new_for_commandline_arg (filename);
uri = g_file_get_uri (file);
fr_window_archive_open (FR_WINDOW (window), uri, GTK_WINDOW (window));
--
2.27.0

View File

@ -14,7 +14,7 @@
Name: engrampa
Version: 1.24.1
Release: 1
Release: 2
Summary: MATE Desktop file archiver
License: GPLv2+ and LGPLv2+
URL: http://mate-desktop.org
@ -33,6 +33,8 @@ BuildRequires: json-glib-devel
#BuildRequires: caja-devel
BuildRequires: libSM-devel
Patch1: 0004-fix-engrampa-Fix-decompress-files-with-garbled-chara.patch
%description
Mate File Archiver is an application for creating and viewing archives files,
such as zip, xv, bzip2, cab, rar and other compress formats.
@ -95,5 +97,8 @@ find %{buildroot} -name "*.la" -exec rm -f {} ';'
%changelog
* Thu Jul 20 2023 longcheng <longcheng@kylinos.com.cn> - 1.24.1-2
- fix(engrampa):Fix decompress files with garbled characters under GB18030 encoding
* Wed Sep 02 2020 douyan <douyan@kylinos.cn> - 1.24.1-1
- package init