jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
450 stars 26 forks source link

Karaoke lyrics in MIDI files sometimes are interpreted as Unicode #268

Closed stuerp closed 1 year ago

stuerp commented 1 year ago

In an upcoming version of foo_midi I convert Soft Karaoke lyrics to a SYNCEDLYRICS tag. Most of the times the panel displays them correctly but sometimes the whole text is displayed as Unicode resulting in a bunch Japanese or Chinese glyphs.

The text is converted to UTF8 before it is added to the tag.

It think the panel gets confused when accented characters are encountered (e.g. in French or Spanish lyrics)

jacquesh commented 1 year ago

openlyrics should be preferring UTF-8 when loading lyrics.

Can you provide an example file that exhibits this behaviour for you? Can you provide debug output from the console for a reproduction of this issue?

stuerp commented 1 year ago

I will attach an example after I release the next version of foo_midi. The only way to see it is by opening an example file with the component. The SYNCHEDLYRICS tag does not get written back to the MIDI file, for obvious reasons.

stuerp commented 1 year ago

I did some checking: my own code was lying to me. In some cases the returned text was not valid UTF-8. After fixing it the test cases are displayed correctly now by your panel. Sorry to have bothered you.

jacquesh commented 1 year ago

Ah ok no problem, that's good to know. Thanks for confirming!