From d48ad40eb2d360a183035e2071a2f4c16b30e3a7 Mon Sep 17 00:00:00 2001
From: root <root@localhost.localdomain>
Date: Thu, 10 Feb 2022 22:17:45 +0800
Subject: [PATCH] select the default charset by locale

---
 src/terminal-window.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/terminal-window.c b/src/terminal-window.c
index df6347c..a6784bc 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -1001,12 +1001,17 @@ terminal_window_update_encoding_menu_active_encoding (TerminalWindow *window)
     TerminalWindowPrivate *priv = window->priv;
     GtkAction *action;
     char name[128];
-
+    const char *charset;
+   
     if (!priv->active_screen)
         return;
     if (!priv->encodings_action_group)
         return;
 
+    g_get_charset (&charset);
+    vte_terminal_set_encoding (VTE_TERMINAL (priv->active_screen),
+                               charset, NULL);
+
     g_snprintf (name, sizeof (name), SET_ENCODING_ACTION_NAME_PREFIX "%s",
                 vte_terminal_get_encoding (VTE_TERMINAL (priv->active_screen)));
     action = gtk_action_group_get_action (priv->encodings_action_group, name);
-- 
2.27.0

