[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmonad
Subject:    [xmonad] spawn functions are not unicode safe
From:       Khudyakov Alexey <alexey.skladnoy () gmail ! com>
Date:       2009-01-14 22:46:47
Message-ID: 200901150146.47729.alexey.skladnoy () gmail ! com
[Download RAW message or body]

Hello.

There is problem with `spawn' function as well with *spawn family from  
XMonad.Util.Run. They mangle unicode symbols which are passed to them. This 
is because they make use of `executeFile' which silently truncate each letter 
to one byte. 

Simplest workaround is to use utf8-string package. It would work only on 
systems with UTF8 locales but now they are majority I hope. 

> import Codec.Binary.UTF8.String
> -- | Unicode safe spawn
> spawnU :: MonadIO m => String -> m ()
> spawnU = spawn . encodeString

The same possible for all *spawn functions. I think it's worth to include 
unicodified versions to XMonadContrib but not sure is there anyone who need 
such functionality

-- 
  Alexey Khudyakov
_______________________________________________
xmonad mailing list
xmonad@haskell.org
http://www.haskell.org/mailman/listinfo/xmonad
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic