[xmonad] spawn functions are not unicode safe

Roman Cheplyaka roma at ro-che.info
Thu Jan 15 08:53:49 EST 2009


* Gwern Branwen <gwern0 at gmail.com> [2009-01-14 19:23:30-0500]
> > whats the benefit to maintaining non unicode spawn behavior? is it
> > needlessly complex to have a spawnA and spawnU and then the actual
> > spawn function determines the more appropriate function to use based
> > on the string itself?
> 
> How would it determine that? I don't know that Data.Char.isLatin1 would suffice.

RFC 3629 [1] states:

   o  UTF-8 strings can be fairly reliably recognized as such by a
      simple algorithm, i.e., the probability that a string of
      characters in any other encoding appears as valid UTF-8 is low,
      diminishing with increasing string length.

However, no references to the algorithm itself are given.

Google brought me this sample algorithm [2].
Probably it's worth to implement something like that and include into
utf8-string if it's not already there.

  1. http://www.ietf.org/rfc/rfc3629.txt
  2. http://mail.nl.linux.org/linux-utf8/1999-09/msg00110.html
-- 
Roman I. Cheplyaka (aka Feuerbach @ IRC)
http://ro-che.info/docs/xmonad.hs


More information about the xmonad mailing list