summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2021-04-27 14:19:53 +0100
committerTomas Janousek <tomi@nomi.cz>2021-04-27 14:39:14 +0100
commit90847c6b79cb536c7ce6bdf4250fd43110f8f8c3 (patch)
tree866872a9acb80cb239063fccbe5ac58c9649f288 /src
parentaced6fe0c2a033dcbb6a1a75bd99ab79d1bc5463 (diff)
downloadxmobar-90847c6b79cb536c7ce6bdf4250fd43110f8f8c3.tar.gz
xmobar-90847c6b79cb536c7ce6bdf4250fd43110f8f8c3.tar.bz2
Revert "Conditional encoding …" and "Avoid double utf8 encoding" (#482)
This reverts commits c6669e26e1 (partially; changelog entry kept), 73e02934d6, 78efa5900a. These commits were introduced as a workaround for a double UTF-8 encoding bug in xmonad-contrib which itself was meant to be a fix/workaround for another issue. We have now identified the underlying issue and fixed it right at the root, so this entire cascade of hacky (and wrong) workarounds can be safely reverted. Thankfully, none of the xmonad-contrib hacks made it into a release, so there's no backward compat to worry about. Should anyone be interested in the details, https://github.com/xmonad/xmonad-contrib/commit/63e31ccd8d2865863778207b679f806941bf2788 provides a summary and links to all the related issues and PRs. Related: https://github.com/jaor/xmobar/pull/482 Related: https://github.com/jaor/xmobar/issues/476 Related: https://github.com/xmonad/xmonad-contrib/commit/63e31ccd8d2865863778207b679f806941bf2788 Related: https://github.com/xmonad/xmonad-contrib/pull/471 Related: https://github.com/xmonad/xmonad-contrib/issues/377
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar/X11/MinXft.hsc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Xmobar/X11/MinXft.hsc b/src/Xmobar/X11/MinXft.hsc
index d6861e6..e593da0 100644
--- a/src/Xmobar/X11/MinXft.hsc
+++ b/src/Xmobar/X11/MinXft.hsc
@@ -161,16 +161,10 @@ 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 =
- withArrayLen (utf8EncodeString string)
+ withArrayLen (map fi (UTF8.encode string))
(\len ptr -> cXftDrawStringUtf8 d c f (fi x) (fi y) ptr (fi len))
drawXftString' :: AXftDraw ->