On Sat, 2 Dec 2006, Pierre Guinoiseau wrote:
Hi,
I've been experiencing this problem :
http://www.fvwm.org/cgi-bin/fvwm-bug/incoming?id=1647;page=8;user=guest
The solution given there works for me, and seems to works too for others
UTF-8 users too. But it is still not corrected, so what is the status
of it ?
The probelm is that there is no documented order in which charsets are
returned by X, and while the change listed in the bug report seems to work
with utf-8 and current X-implementations there is nothing that guarantees
that it will work in the future, nor with every other possible locale.
A fix would have to either remove the concept of a default charset, and
store strings internally together with the charset they are encoded in,
or implement some function to check if a charset is a superset of all
other required charsets, and then use that superset charset as default
charset.
I personally have no time to look inte either of these approaches now, but
the later is definately the simplest, and will most likely work. The only
problem would be if no universal charset existed for all required
charsets, but then it would really not be possible to display all
possible strings at once, so I believe that should not happen.
The biggest problem with the approch is that ther, as far as I know, does
not exist any library functions to check for charset relationship, which
means that any solution would require the relations to be coded into fvwm,
which would add a need to maintain these relations.
Another approach could be to dynamically select the default charset. That
is to change it in the event conversion fails.
/Viktor