[xmonad] UTF8 output from xmonad mangled
alexey.skladnoy at gmail.com
Wed Apr 28 07:18:50 EDT 2010
On Wed, Apr 28, 2010 at 1:11 PM, Norbert Zeh <nzeh at cs.dal.ca> wrote:
> Hi folks,
> I'm using xmobar as my status bar and have problems to get UTF8
> characters to display correctly. I did the following tests:
> 1. Start xmobar, reading input from stdin. Type in some unicode
> characters. Xmobar displays them fine.
> 2. Add some unicode characters to my loghook in xmonad. Things come
> out garbled.
> 3. Instead of piping to xmobar, make xmonad write to a file. The file
> contents are also garbled. To be more precise, they are exactly what
> xmobar shows me in the second test.
> So this seems like the problem is on xmonad's end, not xmobar's. I'm
> running the latest darcs version of xmonad. Any ideas what could be
> causing this?
What version of GHC do you use? Starting from version 6.12 GHC properly
encodes strings. Earlier versions just truncated characters to 0-255 range.
If you use GHC 6.10 or earlier you should use encodeString from utf8-string
package to encode string in utf8 before writing to pipe.
More information about the xmonad