Gramophone icon indicating copy to clipboard operation
Gramophone copied to clipboard

[BUG] Lyrics files in non-UTF-8 encoding are not displayed correctly

Open Reisen-U opened this issue 7 months ago • 4 comments

Describe the bug
Gramophone does not display lyrics correctly when they are not in UTF-8 encoding, resulting in unreadable or garbled text.

To Reproduce
Steps to reproduce the behavior:

  1. Open Gramophone.
  2. Play a song that has a .lrc file in a non-UTF-8 encoding (e.g., GBK, Shift-JIS).
  3. The lyrics will appear as gibberish or unreadable characters.
  4. See the error.

Expected behavior
The lyrics should display correctly, regardless of the encoding format. Ideally, the app should either auto-detect and properly decode various encodings or offer a way to specify the correct encoding.

Screenshots
[when .lrc is in utf-8]

by:CHHKKE
帰り道は夕日を背に/背着夕阳走在返家的路上

Image

[when .lrc is in GBK]

by:CHHKKE
�������Ϧ�դ򱳤�/����Ϧ�����ڷ��ҵ�·��

Image

Smartphone:

  • Device: [POCO F3]
  • OS: [Android 15]
  • App Version: [1.0.16.1]

Additional context
The app only seems to properly read UTF-8 encoded lyrics files. Non-UTF-8 files result in incorrect or unreadable text.

  • [ ✓ ] I will open one issue per bug, follow the issue format and will add [BUG] to the start of my issue title, and I acknowledge that if I don't follow the format, my issue might get closed without further explanation.

Reisen-U avatar May 10 '25 16:05 Reisen-U

Hi, is there any specific reason you can't use UTF-8 files? There's no mention of how to specify encoding in the informal standard docs I'm aware of, I don't want to introduce an app-specific way as 1. adding a toggle in UI would make it cramped 2. you'd need to edit files anyway for a in-file toggle, when you could just convert to utf8 3. there's already enough fragmentation. Automatic character set detection can't ever work in 100% of cases and it's non-trivial to code. Hence I personally think utf8 is the best solution, tbh.

nift4 avatar May 10 '25 16:05 nift4

There are certain albums whose .lrc files come in non-UTF-8 encodings, like GBK or Shift-JIS, which are common in some regions. These files often appear as gibberish in the app.

I understand the preference for sticking to UTF-8 and the reasoning behind avoiding additional complexity. However, if this feature proves unnecessary, I can always manually convert my files. I just wanted to bring it up as a suggestion for improving the experience—feel free to treat this as a “nice-to-have” rather than an urgent fix. Thank you for all your hard work!

Reisen-U avatar May 10 '25 23:05 Reisen-U

@Reisen-U Makes sense. I'll keep this issue open and look into adding a simple charset detector (juniversalchardet) as backlog item. Thanks for the report!

nift4 avatar May 11 '25 07:05 nift4

Thank you for your kindness I have converted all my lyrics to utf-8 format :D

Reisen-U avatar May 11 '25 14:05 Reisen-U