[xmonad] Re: X.A.Search & UTF8

Gwern Branwen gwern0 at gmail.com
Tue Dec 1 14:16:47 EST 2009


On Tue, Dec 1, 2009 at 12:59 PM, Konstantin Sobolev
<konstantin.sobolev at gmail.com> wrote:
> Hello,
>
> I'm trying out X.A.Search and as I can see it doesn't work with
> non-latin characters out of the box

Doesn't surprise me at all.

> For instance cyrillic text gets
> converted into some hex-looking mess. The following fixes it for me,
> but I'm not sure if we can add a dependency on  utf8-string:

We can, since it's already there:
http://hackage.haskell.org/package/xmonad-contrib

> + import Codec.Binary.UTF8.String ( utf8Encode )
> ...
> - searchEngine name site = searchEngineF name (\s -> site ++ (escape s))
> + searchEngine name site = searchEngineF name (\s -> site ++
> (utf8Encode (escape s)))

The problem is that encoding is apparently not a cost-free solution,
and we've run into many issues in the past:
http://www.google.com/search?q=UTF-8+site:http://www.haskell.org/pipermail/xmonad/&start=10&sa=N

>From what I remember of the spawn & prompt discussions, someone said
using Encode can mess up still other strings and there's no way to
know whether or not to use Encode.

-- 
gwern


More information about the xmonad mailing list