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

