summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSibi Prabakaran <sibi@psibi.in>2020-08-09 13:09:38 +0530
committerSibi Prabakaran <sibi@psibi.in>2020-08-09 13:09:51 +0530
commitc6669e26e1ee9ef6ff9b0e5d2e85df15ad731140 (patch)
tree3d65ef1ded2aa80f0d405ebebd08c5c856bc8aeb
parent73e02934d68dfaf04bbb36dbb2e3b52b042c65bb (diff)
downloadxmobar-c6669e26e1ee9ef6ff9b0e5d2e85df15ad731140.tar.gz
xmobar-c6669e26e1ee9ef6ff9b0e5d2e85df15ad731140.tar.bz2
Update changelog and add comment
-rw-r--r--changelog.md2
-rw-r--r--src/Xmobar/X11/MinXft.hsc2
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index d42e772..c86a67c 100644
--- a/changelog.md
+++ b/changelog.md
@@ -11,6 +11,8 @@ _Bug fixes_
- Documentation fixes (Tomáš Janoušek)
- Don't get confused by empty configuration dirs (fixes #412)
+ - Xft rendering: Avoid encoding to UTF8 on all scenarios. This
+ causes issue to StdinReader monitor when the handle wasn't binary.
## Version 0.35.1 (June, 2020)
diff --git a/src/Xmobar/X11/MinXft.hsc b/src/Xmobar/X11/MinXft.hsc
index 22edf8f..d6861e6 100644
--- a/src/Xmobar/X11/MinXft.hsc
+++ b/src/Xmobar/X11/MinXft.hsc
@@ -161,12 +161,12 @@ withAXftDraw d p v c act = do
foreign import ccall "XftDrawStringUtf8"
cXftDrawStringUtf8 :: AXftDraw -> AXftColor -> AXftFont -> CInt -> CInt -> Ptr (#type FcChar8) -> CInt -> IO ()
+-- Fixes https://github.com/jaor/xmobar/issues/476
utf8EncodeString :: Num b => String -> [b]
utf8EncodeString str = if UTF8.isUTF8Encoded str
then map (fi . ord) str
else map fi (UTF8.encode str)
-
drawXftString :: (Integral a1, Integral a) =>
AXftDraw -> AXftColor -> AXftFont -> a -> a1 -> String -> IO ()
drawXftString d c f x y string =