Skip to content
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

Truncating non-ascii characters displays unprintable characters causing polybar to freak out. #34

Open
vymvn opened this issue Apr 13, 2023 · 0 comments

Comments

@vymvn
Copy link

vymvn commented Apr 13, 2023

As the title says, long non-english song titles sometimes have this bug when truncated.

Polybar log error:

polybar|warn:  Dropping unmatched character  (U+0011) in '  Твин Пикс - По шанхай�.'

The bar gets completely blanked out and blurred by my compositer (picom). And if I kill picom it will just be a blank black line.

Also I have noticed that some non-english titles get truncated as normal but some cause this. The non-english titles that broke it with me is Russian and Arabic characters.

Steps to reproduce:

  • Polybar module:
[module/spotify]
type = custom/ipc
; Default
hook-0 = echo ""
; Playing/paused show song name and artist
hook-1 = spotifyctl -q status --format '%artist% - %title%' --max-length 50 --max-title-length 20 --max-artist-length 20 --trunc '..'
  • Song with title that includes "bad" characters:

https://open.spotify.com/track/26HmgTNZiSyTtK8iWw8cxv?si=b0da790af46e445d

Also here is an example of a song witch Russian characters that gets truncated normally:

https://open.spotify.com/track/5Qbmmuhe3kvAFZ4Oe6kfmP?si=f38ba013e05a499f

I have tried to fix by messing with truncating function in utils.c but I couldn't figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant