UTF-8 encoding XSetClassHint

Rafał Jopek rafaljopek at hotmail.com
Mon Jan 17 17:03:22 UTC 2022


Hi,

I would like to kindly ask you to provide information
on whether it is possible to set the UTF-8 encoding for the function `XSetClassHint`
I have not found any information on this subject anywhere,
decided to write here, I am sure it is possible, can someone provide an example?

```
   XStoreName(xw.dpy, xw.win, xw.win_name);
   XSetIconName(xw.dpy, xw.win, xw.win_name);

   XChangeProperty( xw.dpy, xw.win,
         XInternAtom( xw.dpy, "_NET_WM_NAME", False ),
         XInternAtom( xw.dpy, "UTF8_STRING", False ),
         8, PropModeReplace, ( unsigned char * ) xw.win_name,
         strlen( xw.win_name ) );
   XChangeProperty( xw.dpy, xw.win,
         XInternAtom( xw.dpy, "_NET_WM_ICON_NAME", False ),
         XInternAtom( xw.dpy, "UTF8_STRING", False ),
         8, PropModeReplace, ( unsigned char * ) xw.win_name,
         strlen( xw.win_name ) );

   XClassHint * classhint = XAllocClassHint();
   if( classhint )
   {
      classhint->res_name = classhint->res_class = ( char * ) xw.win_name;
      XSetClassHint( xw.dpy, xw.win, classhint );
      XFree( classhint );
   }
```


Best regards
- Rafał
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20220117/7855c8be/attachment.htm>


More information about the xorg mailing list