codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

XMonad.Util.Run needs to not encode with recent ghc #611

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
ghc 7.8 (I think; certainly 7.10) and later automatically encode strings used 
as command line parameters. XMonad.Util.Run has encoding code intended for 
older ghc versions which truncate instead of encoding; this leads to double 
encoding.

Original issue reported on code.google.com by allber...@gmail.com on 13 Aug 2015 at 5:58

GoogleCodeExporter commented 8 years ago
Minimal config to reproduce the issue discussed on IRC (using xmobar).

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run

myLogHook h = dynamicLogWithPP $ xmobarPP
    {   ppOutput = hPutStrLn h
    }

main :: IO ()
main = do
    xmobar <- spawnPipe "xmobar --font='xft:DejaVu Sans Mono,Symbola' --commands='[Run StdinReader]' -t '%StdinReader%}{😄'"
    xmonad $
        defaultConfig
        { modMask            = mod4Mask
        , logHook            = myLogHook xmobar
        , layoutHook = avoidStruts $ layoutHook defaultConfig
        }

Original comment by arussell...@gmail.com on 13 Aug 2015 at 6:09

GoogleCodeExporter commented 8 years ago
Looks like something mangled part of that into a smiley (see the end of the 
spawnPipe line).

Original comment by allber...@gmail.com on 14 Aug 2015 at 3:19

GoogleCodeExporter commented 8 years ago
That's intentional. I just used an emoji as an example of a character that is 
encoded improperly. The issue arises from any multibyte character.

Original comment by arussell...@gmail.com on 14 Aug 2015 at 5:09