[Xmonad] XSelection.hs - Unicode problems

Andrea Rossato mailing_list at istitutocolli.org
Sun Sep 2 02:47:01 EDT 2007


On Sun, Sep 02, 2007 at 01:00:53AM +0200, Mats Jansborg wrote:
> Andrea Rossato <mailing_list at istitutocolli.org> writes:
> 
> > I hope Mats Jansborg is still reading the mailing list: hopefully he
> > could give us some direction.
> 
> I am, sorry for the late reply. Although I'm not sure I'm comfortable
> being appointed some kind of x11 unicode authority; I'm completely new
> to low-level X11 programming and what knowledge I have can be had more
> quickly and reliably by reading the X11 manual, the ICCCM and Keith
> Packard's paper at http://keithp.com/~keithp/talks/selection.ps.

You may not be an authority but you gave me a great help, with many
useful references. Thanks you!


> The other problem is that you ask for the selection in the STRING
> encoding. This limits its usefulness immensely, as STRING is unlikely to
> support many of the characters in the user's locale. X11 and ICCCM
> defines a method of negotiating the format of the selection. Both
> UTF8_STRING (which is not in ICCCM but supported by most modern
> applications) and COMPOUND_TEXT should imho be preferred to STRING which
> can be used as fallback encoding if neither of the two first two are
> available. I've previously posted an example of how to read compound text
> properties in my patch to the NamedWindow module, although that method
> is not portable either since it uses withCWString from Foreign.C.String
> which works correctly only if __STDC_ISO_10646__ is defined (i.e. if
> wchar_t is UTF-

I don't get all the issues involved in converting the selection yet.
As a quick try I started using COMPUND_TEXT, which seems to be working
well with the ISO-8859-1 character set (Poincar� now works!).

For the rest, I think I'll have something to study in the next
days...;-)

Thank you.

Andrea

ps: Gwern, you can update hxsel.


More information about the Xmonad mailing list