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

Konstantin Sobolev konstantin.sobolev at gmail.com
Tue Dec 1 14:50:51 EST 2009


>> + 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

Here's refined search:
http://www.google.com/search?q=search+-patch+UTF-8+site:http://www.haskell.org/pipermail/xmonad/

> 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.

As I understand this might not work on the systems with non-unicode locale?

I've ended up with this workaround:

utf8SearchEngine :: SearchEngine -> SearchEngine
utf8SearchEngine (SearchEngine name site) = searchEngineF name
(utf8Encode . site)

google'     = utf8SearchEngine google
wikipedia'  = utf8SearchEngine wikipedia
...


More information about the xmonad mailing list