# HG changeset patch # User Manuel Jacob # Date 1593359354 -7200 # Node ID a65c60f3280eb1221045d5b643488256b6cb89e0 # Parent 752da6863e394ac1cad6e69932ddca3cd564da6b curses: back out d2227d4c9e6b (do not initialize LC_ALL to user settings) The changeset was based on a25343d16ebe, which will be backed out, too. Another fix for the problem will be resubmitted to the stable branch. diff -r 752da6863e39 -r a65c60f3280e hgext/histedit.py --- a/hgext/histedit.py Thu Jun 25 11:22:34 2020 +0200 +++ b/hgext/histedit.py Sun Jun 28 17:49:14 2020 +0200 @@ -201,6 +201,7 @@ termios = None import functools +import locale import os import struct @@ -1710,6 +1711,10 @@ ctxs = [] for i, r in enumerate(revs): ctxs.append(histeditrule(ui, repo[r], i)) + # Curses requires setting the locale or it will default to the C + # locale. This sets the locale to the user's default system + # locale. + locale.setlocale(locale.LC_ALL, '') rc = curses.wrapper(functools.partial(_chisteditmain, repo, ctxs)) curses.echo() curses.endwin() diff -r 752da6863e39 -r a65c60f3280e mercurial/crecord.py --- a/mercurial/crecord.py Thu Jun 25 11:22:34 2020 +0200 +++ b/mercurial/crecord.py Sun Jun 28 17:49:14 2020 +0200 @@ -10,6 +10,7 @@ from __future__ import absolute_import +import locale import os import re import signal @@ -565,6 +566,9 @@ """ ui.write(_(b'starting interactive selection\n')) chunkselector = curseschunkselector(headerlist, ui, operation) + # This is required for ncurses to display non-ASCII characters in + # default user locale encoding correctly. --immerrr + locale.setlocale(locale.LC_ALL, '') origsigtstp = sentinel = object() if util.safehasattr(signal, b'SIGTSTP'): origsigtstp = signal.getsignal(signal.SIGTSTP)