From 90847c6b79cb536c7ce6bdf4250fd43110f8f8c3 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Tue, 27 Apr 2021 14:19:53 +0100 Subject: Revert "Conditional encoding …" and "Avoid double utf8 encoding" (#482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/Xmobar/X11/MinXft.hsc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') 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 -> -- cgit v1.2.3