Skip to content

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

Description

@windowsoffender

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions