New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XMonad.Hooks.DynamicLog corrupt non-ASC characters #377
Comments
This is due to the behaviour introduced in
xmonad/xmonad-contrib#346. The TL;DR is that this was fixed in
jaor/xmobar/pull/482, which is part of xmobar 0.36 and so updating your
version of xmobar should fix the issue.
|
I updated from My Config { font = "-misc-fixed-*-*-*-*-14-*-*-*-*-*-*-*"
, additionalFonts = []
, wmClass = "xmobar"
, wmName = "xmobar"
, bgColor = "#000000"
, fgColor = "#BFBFBF"
, alpha = 255
, position = TopSize R 100 20
, border = NoBorder
, borderColor = "#BFBFBF"
, borderWidth = 1
, textOffset = -1
, iconOffset = -1
, textOffsets = []
, hideOnStart = False
, lowerOnStart = True
, persistent = False
, allDesktops = True
, overrideRedirect = True
, pickBroadest = False
, iconRoot = "."
, commands = [ Run Date "%a %b %_d %Y * %H:%M:%S" "theDate" 10
, Run StdinReader
, Run Battery [] 60
, Run Com ".config/xmobar/padding-icon.sh" [] "trayerpad" 30
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %battery% * <fc=#FF0000>%theDate%</fc> * %trayerpad%"
, verbose = False
} As i know, this config does not requires recompilation. |
Temporary solved via changing diff --git a/.config/xmobar/xmobarrc b/.config/xmobar/xmobarrc
index 8bd56a2..cdcbc56 100644
--- a/.config/xmobar/xmobarrc
+++ b/.config/xmobar/xmobarrc
@@ -1,4 +1,4 @@
-Config { font = "-misc-fixed-*-*-*-*-14-*-*-*-*-*-*-*"
+Config { font = "xft:monospace:size=10"
, additionalFonts = []
, wmClass = "xmobar"
, wmName = "xmobar" |
Also having the issue as of yesterday, using this |
This actually sounds like #338 (comment) |
@PRESFIL Just so that you understand why upgrading xmobar didn't help but switching to xft did: the ugly hack/workaround @psibi submitted to xmobar in https://github.com/jaor/xmobar/pull/482 was only implemented for xft. The xlfd code path still expects a proper unicode String (not double-utf8 encoded garbage). I'll create a PR to fix this (#338 (comment)). |
The screenshots in the header show that only non-latin characters are corrupted. Perhaps they remain correct because in utf-8, ASCII characters are unique and cannot be prefixes of multibyte sequences, so decoding occurs uniquely. And the rest of the characters are encoded twice. I can still reproduce this behavior, although the Another question is why changing fonts solves the problem. Maybe in the XLFT handler (I don't know if I call this one In any case, I will be able to confirm if your solution works, on my host. |
“the ugly hack/workaround @psibi submitted to xmobar in jaor/xmobar#482 was only implemented for xft” |
Ok I have nothing more to say. It seems I told you something you already know... |
…pLog' For many (10+) years, we had a cascade of ugly workarounds: * X.U.Run.spawnPipe returned a binary handle, so the String passed to it must have been encoded by C.B.UTF8.String.encodeString * X.H.DynamicLog.dynamicLogString therefore returned such an encoded String, so one could use it directly in a hPutStrLn, but literal Strings wouldn't work * xmonadPropLog' also expected an encoded String to make it easier to use together with dynamicLogString, again breaking usage with String literals and other normal unicode Strings Then in 1d0eadd Sibi fixed spawnPipe to return a handle usable with normal Strings, which then obviously broke the entire cascade. But, instead of using the opportunity to remove all the ugly workarounds, he decided to add some more on top, so now spawnPipe with dynamicLogString outputs doubly encoded UTF-8 and xmobar has a hack to strip this double encoding (https://github.com/jaor/xmobar/pull/482), which only works when XFT is in use and breaks on some long unicode codepoints. :-( There is a better way: make everything just use normal Strings and only encode when it goes out the wire. This means dynamicLogString can be freely mixed with String literals, manual uses of xmonadPropLog' don't need encodeString, and everything just works nicely. This obviously breaks configs that used some of these pieces in isolation (like mine), but that's a small price to pay. After all, right now all users of spawnPipe/dynamicLogString are getting doubly encoded UTF-8 which might or might not work in xmobar and probably breaks horribly everywhere else, so this fix should be a clear improvement. :-) Fixes: 1d0eadd ("Make spawnPipe to use system's locale encoding") Fixes: xmonad#377 Fixes: https://github.com/jaor/xmobar/issues/476 Related: xmonad#334 Related: https://github.com/jaor/xmobar/pull/482
…pLog' For many (10+) years, we had a cascade of ugly workarounds: * X.U.Run.spawnPipe returned a binary handle, so the String passed to it must have been encoded by C.B.UTF8.String.encodeString * X.H.DynamicLog.dynamicLogString therefore returned such an encoded String, so one could use it directly in a hPutStrLn, but literal Strings wouldn't work * xmonadPropLog' also expected an encoded String to make it easier to use together with dynamicLogString, again breaking usage with String literals and other normal unicode Strings Then in 1d0eadd Sibi fixed spawnPipe to return a handle usable with normal Strings, which then obviously broke the entire cascade. But, instead of using the opportunity to remove all the ugly workarounds, he decided to add some more on top, so now spawnPipe with dynamicLogString outputs doubly encoded UTF-8 and xmobar has a hack to strip this double encoding (https://github.com/jaor/xmobar/pull/482), which only works when XFT is in use and breaks on some long unicode codepoints. :-( There is a better way: make everything just use normal Strings and only encode when it goes out the wire. This means dynamicLogString can be freely mixed with String literals, manual uses of xmonadPropLog' don't need encodeString, and everything just works nicely. This obviously breaks configs that used some of these pieces in isolation (like mine), but that's a small price to pay. After all, right now all users of spawnPipe/dynamicLogString are getting doubly encoded UTF-8 which might or might not work in xmobar and probably breaks horribly everywhere else, so this fix should be a clear improvement. :-) Fixes: 1d0eadd ("Make spawnPipe to use system's locale encoding") Fixes: xmonad#377 Fixes: https://github.com/jaor/xmobar/issues/476 Related: xmonad#334 Related: https://github.com/jaor/xmobar/pull/482
…pLog' For many (10+) years, we had a cascade of ugly workarounds: * X.U.Run.spawnPipe returned a binary handle, so the String passed to it must have been encoded by C.B.UTF8.String.encodeString * X.H.DynamicLog.dynamicLogString therefore returned such an encoded String, so one could use it directly in a hPutStrLn, but literal Strings wouldn't work * xmonadPropLog' also expected an encoded String to make it easier to use together with dynamicLogString, again breaking usage with String literals and other normal unicode Strings Then in 1d0eadd Sibi fixed spawnPipe to return a handle usable with normal Strings, which then obviously broke the entire cascade. But, instead of using the opportunity to remove all the ugly workarounds, he decided to add some more on top, so now spawnPipe with dynamicLogString outputs doubly encoded UTF-8 and xmobar has a hack to strip this double encoding (https://github.com/jaor/xmobar/pull/482), which only works when XFT is in use and breaks on some long unicode codepoints. :-( There is a better way: make everything just use normal Strings and only encode when it goes out the wire. This means dynamicLogString can be freely mixed with String literals, manual uses of xmonadPropLog' don't need encodeString, and everything just works nicely. This obviously breaks configs that used some of these pieces in isolation (like mine), but that's a small price to pay. After all, right now all users of spawnPipe/dynamicLogString are getting doubly encoded UTF-8 which might or might not work in xmobar and probably breaks horribly everywhere else, so this fix should be a clear improvement. :-) Fixes: 1d0eadd ("Make spawnPipe to use system's locale encoding") Fixes: xmonad#377 Fixes: https://github.com/jaor/xmobar/issues/476 Related: xmonad#334 Related: https://github.com/jaor/xmobar/pull/482
It seems to work now with #471: I hope this PR doesn't damage other bars like |
It should actually fix them rather than break them. :-) |
Ok... 👀 |
…pLog' For many (10+) years, we had a cascade of ugly workarounds: * X.U.Run.spawnPipe returned a binary handle, so the String passed to it must have been encoded by C.B.UTF8.String.encodeString * X.H.DynamicLog.dynamicLogString therefore returned such an encoded String, so one could use it directly in a hPutStrLn, but literal Strings wouldn't work * xmonadPropLog' also expected an encoded String to make it easier to use together with dynamicLogString, again breaking usage with String literals and other normal unicode Strings Then in 1d0eadd Sibi fixed spawnPipe to return a handle usable with normal Strings, which then obviously broke the entire cascade. But, instead of using the opportunity to remove all the ugly workarounds, he decided to add some more on top, so now spawnPipe with dynamicLogString outputs doubly encoded UTF-8 and xmobar has a hack to strip this double encoding (https://github.com/jaor/xmobar/pull/482), which only works when XFT is in use and breaks on some long unicode codepoints. :-( There is a better way: make everything just use normal Strings and only encode when it goes out the wire. This means dynamicLogString can be freely mixed with String literals, manual uses of xmonadPropLog' don't need encodeString, and everything just works nicely. This obviously breaks configs that used some of these pieces in isolation (like mine), but that's a small price to pay. After all, right now all users of spawnPipe/dynamicLogString are getting doubly encoded UTF-8 which might or might not work in xmobar and probably breaks horribly everywhere else, so this fix should be a clear improvement. :-) Fixes: 1d0eadd ("Make spawnPipe to use system's locale encoding") Fixes: xmonad#377 Fixes: https://github.com/jaor/xmobar/issues/476 Related: xmonad#334 Related: https://github.com/jaor/xmobar/pull/482
Thanks! 🚀 |
This reverts commits c6669e2 (partially; (changelog entry kept), 73e0293, 78efa59. 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, xmonad/xmonad-contrib@63e31cc 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: xmonad/xmonad-contrib@63e31cc Related: xmonad/xmonad-contrib#471 Related: xmonad/xmonad-contrib#377
This reverts commits c6669e2 (partially; changelog entry kept), 73e0293, 78efa59. 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, xmonad/xmonad-contrib@63e31cc 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: xmonad/xmonad-contrib@63e31cc Related: xmonad/xmonad-contrib#471 Related: xmonad/xmonad-contrib#377
Problem Description
I switched from
xmonad-contrib==0.16-31
+xmonad==0.15-51
toxmonad-contrib-git
+xmonad-git
. Now, inxmobar==0.35.31
characters are corrupted:NOTE: last commit on git version - 58feba91d96fee8339d7cf56fb33537be819eb4b
Then, i switching back to
xmonad-contrib==0.16-31
+xmonad==0.15-51
and:Is there are some default behavior of
xmonad
/X.H.DynamicLog
changed or maintainer has forgotten some compile parameters for supportutf-8
?Configuration File
My test configuration:
My fallback configuration:
Checklist
Other
My Linux distribution: Manjaro 20.1
I newbie. I wanted to try a new feature to use the normal fullscreen-mode implementation for Firefox (for me that worked, but this thing has appeared ;В). Thanks in advance.
The text was updated successfully, but these errors were encountered: