Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

wrong encoding of the window title in X11 #224

Open
vejkse opened this issue Jan 22, 2020 · 1 comment
Open

wrong encoding of the window title in X11 #224

vejkse opened this issue Jan 22, 2020 · 1 comment
Labels

Comments

@vejkse
Copy link

vejkse commented Jan 22, 2020

Context : I’m using imv 4.1.0 with xmonad in ArchLinux. My default encoding is UTF-8.

If I open a file named pétale….jpg with imv, the file name as it appears in the window title is “pétaleâ\302\200¦.jpg”.

With feh, the name is shown correctly. If use xprop on the feh window, I get several properties containing the window title: WM_NAME(STRING) and WM_ICON_NAME(STRING), containing the wrongly encoded version, and _NET_WM_NAME(UTF8_STRING) and _NET_WM_ICON_NAME(UTF8_STRING), containing the correctly encoded version. imv only has the WM_NAME(STRING) property.

According to https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html the window manager should use _NET_WM_NAME in preference to WM_NAME, which explains why xmonad shows the correctly encoded title for feh. So it seems that the problem would be solved if imv set the _NET_WM_NAME to the title. (See also https://stackoverflow.com/a/7706816.) Added: this may be useful: https://stackoverflow.com/questions/23273292/how-to-change-net-wm-name-x-library (I’m not sure).

Partial workaround: if set in my config file title_text = "$(echo "$imv_current_file" | iconv -f UTF-8 -t WINDOWS-1252)", the window title becomes: “pétale\302\205.jpg”, the “\302\205” appearing as a box for a missing character.

@vejkse vejkse changed the title wrong encoding of the window title wrong encoding of the window title in X11 Jan 22, 2020
@eXeC64
Copy link
Owner

eXeC64 commented Feb 2, 2020

Hi, thanks for the detailed bug report. This is a good catch. I'll try to get this fixed for the next release.

@eXeC64 eXeC64 added the Bug label Feb 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants