Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input line is echoing utf8 chars on non-utf8 terminal #1018

Closed
pyksy opened this issue Feb 20, 2019 · 6 comments

Comments

Projects
None yet
5 participants
@pyksy
Copy link

commented Feb 20, 2019

I have a legacy Linux installation that still uses ISO-8859-1 charset. Commit 9072e98 causes irssi to erroneously echo utf8 chars to the input line (start irssi, press 'ä' key, irssi outputs 'ä' on the input line, cursor is placed between the two chars) instead of ISO-8859-1. Everything else seems to work fine, with no encoding problems when sending/receiving text from/to IRC channels. Only input line is affected.

@dequis

This comment has been minimized.

Copy link
Member

commented Feb 20, 2019

Relevant: #671

@saahriktu

This comment has been minimized.

Copy link

commented Feb 20, 2019

diff -ru irssi-1.2.0/src/fe-text/gui-entry.c irssi-1.2.0_patched/src/fe-text/gui-entry.c
--- irssi-1.2.0/src/fe-text/gui-entry.c 2019-02-11 20:27:58.000000000 +0300
+++ irssi-1.2.0_patched/src/fe-text/gui-entry.c 2019-02-19 17:48:00.468255567 +0300
@@ -381,8 +381,12 @@
 
                if (entry->hidden)
                         g_string_append_c(str, ' ');
-               else if (unichar_isprint(c))
-                       g_string_append_unichar(str, c);
+               else if (unichar_isprint(c)) {
+                       if (entry->utf8)
+                               g_string_append_unichar(str, c);
+                       else
+                               g_string_append_c(str, c);
+               }
                else {
                        g_string_append_c(str, 4);
                        g_string_append_c(str, FORMAT_STYLE_REVERSE);
@pyksy

This comment has been minimized.

Copy link
Author

commented Feb 20, 2019

Thank you @saahriktu, that patch seems to fix the charset problem.

@ailin-nemui

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

nice catch. I am wondering if this fixes/breaks Big5 terminals

@phyber

This comment has been minimized.

Copy link

commented Jun 16, 2019

Do we know if this patch has any adverse effects on on those terminals or anything else yet? It was requested that this patch be added to the FreeBSD port, but I'm unsure since I can't easily test it myself.

@ailin-nemui

This comment has been minimized.

Copy link
Contributor

commented Jun 17, 2019

@pyksy @saahriktu can you verify if I didn't screw up in #1057

@ailin-nemui ailin-nemui added this to the 1.2.1 milestone Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.