musikcube icon indicating copy to clipboard operation
musikcube copied to clipboard

Emoji's in song titles cause track list display issues

Open LydiaUwU opened this issue 3 years ago • 3 comments

Guessing it's down to them not fitting within a monospace character's width. See attached image.

image

LydiaUwU avatar Oct 22 '21 14:10 LydiaUwU

Nice find! I've been messing with this off-and-on for a little bit now, but I haven't been able to find a solution. It seems that internally ncurses uses wcwidth (https://man7.org/linux/man-pages/man3/wcwidth.3.html) to measure strings (as does musikcube), and it appears the implementation doesn't handle emojis well. Unfortunately, I'm not sure how to fix this. I can switch the musikcube implementation to something custom that handles them better, but internally ncurses will still use the broken version.

I'm not sure how to proceed; if anyone reading this bug report has any ideas, please let me know.

clangen avatar Dec 22 '21 05:12 clangen

@LydiaUwU I'm running musikcube (version 0.98.0 #6a440c69) inside tmux (3.3a) with alacritty (0.10.1) and am unable to reproduce the issue (see screenshot below). Which terminal and version of musikcube are you using?

I did have similar looking issues in the past with some music files that did not contain emoji, but found that the audio files' metadata contained "strange" unicode characters; possibly a variant selector character U+FE0E or U+FE0F, unfortunately I do not remember exactly which character(s) right now.

image

Please find below my metadata for the JPEGMAFIA's 🔥 track as displayed by mutagen's mid3v2:

% mid3v2 -l 15\ 🔥.mp3
IDv2 tag info for 15 🔥.mp3
APIC=other,  (image/jpeg, 360285 bytes)
COMM==eng=Visit https://jpegmafia.bandcamp.com
TALB=LP!
TCON=Hip Hop
TDRC=2021
TIT2=🔥
TPE1=JPEGMAFIA
TRCK=15/20
» mid3v2 -l 15\ 🔥.mp3 | od -x
0000000      4449    3276    7420    6761    6920    666e    206f    6f66
0000020      2072    3531    f020    949f    2ea5    706d    0a33    5041
0000040      4349    6f3d    6874    7265    202c    2820    6d69    6761
0000060      2f65    706a    6765    202c    3633    3230    3538    6220
0000100      7479    7365    0a29    4f43    4d4d    3d3d    6e65    3d67
0000120      6956    6973    2074    7468    7074    3a73    2f2f    706a
0000140      6765    616d    6966    2e61    6162    646e    6163    706d
0000160      632e    6d6f    540a    4c41    3d42    504c    0a21    4354
0000200      4e4f    483d    7069    4820    706f    540a    5244    3d43
0000220      3032    3132    540a    5449    3d32    9ff0    a594    540a
0000240      4550    3d31    504a    4745    414d    4946    0a41    5254
0000260      4b43    313d    2f35    3032    000a

afh avatar Jul 14 '22 13:07 afh

I'm able to reproduce the issue when running ./result/bin/musikcube from a nix dev shell (nix develop -c $SHELL with the flake.* files (see below) in my musikcube git clone). When running the same binary in a my regular shell the issue does not appear.

Comparing the shell environment (env | sort) does not reveal anything obvious at first glance.

flake.nix.txt, flake.lock.txt ℹ️ GitHub does not accept file attachments with .nix and .lock suffix, hence it was necessary to add the .txt in order to be able to upload it here. If you'd like to use the flake.* files (e.g. for nix build) please remove the .txt suffix after downloading.

afh avatar Jul 17 '22 09:07 afh