[xmonad] spawn functions are not unicode safe
wferi at niif.hu
Sun Jan 18 19:15:58 EST 2009
Khudyakov Alexey <alexey.skladnoy at gmail.com> writes:
> So I think it sound solution to wrap everything into
> encodeString. It is not The Right Way To Do Things. It's only a
> workaround... still better than nothing. It's job for standard
> libraries... not for software developers.
Well put. But it would be best to keep Xmonad encoding agnostic.
Filenames are byte sequences, so spawn should take [Word8] instead of
[Char]. Otherwise the best it can do is convert [Char] to [Word8] by
truncating each Char. Nothing guarrantees that every executable has
an UTF-8 name, after all, even if the default system locale is UTF-8.
It's better to investigate where the argument of spawn comes from, and
handle the problem there. Xlib knows about character encodings, maybe
we could use its facilities and thus avoid adding further dependencies.
More information about the xmonad