Currently, UTF-8 characters don't render correctly in window titles (c.f. screenshots below). This is likely due to the fact that the X11 driver only uses XStoreName, which sets a name in a way that's not really intended for the user to see. This PR fixes that, making it possible to use UTF-8 characters (I tested diacritics and emojis) in the window title.
How ?
In addition to the existing XStoreName call, I also call XChangeProperty to set the _NET_WM_NAME/UTF8_STRING property. This adds one possible point of failure: XChangeProperty takes an int nelements as its last parameter, and the actual length of the string could be bigger than what a c_int can store. In the unlikely event that this happens, a specific error message is returned.
Screenshots (context: I replaced a dash - with an em dash — in the fractal example)
Before:
After:
Feel free to ask me to change a few things if needed, this PR is spontaneous, and I've never got to discuss the issue before.
Currently, UTF-8 characters don't render correctly in window titles (c.f. screenshots below). This is likely due to the fact that the X11 driver only uses
XStoreName
, which sets a name in a way that's not really intended for the user to see. This PR fixes that, making it possible to use UTF-8 characters (I tested diacritics and emojis) in the window title.How ?
In addition to the existing
XStoreName
call, I also callXChangeProperty
to set the_NET_WM_NAME
/UTF8_STRING
property. This adds one possible point of failure:XChangeProperty
takes anint nelements
as its last parameter, and the actual length of the string could be bigger than what ac_int
can store. In the unlikely event that this happens, a specific error message is returned.Screenshots (context: I replaced a dash
-
with an em dash—
in the fractal example)Before:
After:
![fractal2](https://user-images.githubusercontent.com/46636609/167134517-4137351e-9001-4439-99cd-af32406cd385.png)
Feel free to ask me to change a few things if needed, this PR is spontaneous, and I've never got to discuss the issue before.