AxelTerizaki / ultrastar2ass

Convert Ultrastar karaoke files to ASS files
MIT License
5 stars 0 forks source link

Encoding issues #8

Closed henrydatei closed 2 weeks ago

henrydatei commented 2 weeks ago

Your tools works great when dealing with English songs but breaks when using it for German songs containing umlauts (like ä, ü, ö, and ß) or Spanish songs containing letters with accents or questions (é, ¿, ...). As far as I've seen the .txt files from https://ultrastar-es.org/ have an ISO 8859-1 encoding and everything is fine there but the .ass file has UTF-8 as encoding (at least my editor thinks that) and opening it with ISO 8859-1 encoding doesn't help.

For example the line (from Daddy Yankee - La despedida)

: 146 5 14 Sé
: 155 4 14  que
: 164 6 14  so
: 175 7 14 ña
: 185 4 12 ré
: 192 4 12  con
: 200 7 12  tu
: 209 8 16  re
: 218 10 14 gre
: 231 17 9 so

gets converted to (UTF-8)

Comment: 1,0:00:50.07,0:00:53.17,Default,,0,0,0,karaoke,{\k24}S� {\k24}que {\k29}so{\k26}�a{\k18}r� {\k21}con {\k24}tu {\k24}re{\k34}gre{\k72}so

or (ISO 8859-1)

Comment: 1,0:00:50.07,0:00:53.17,Default,,0,0,0,karaoke,{\k24}S� {\k24}que {\k29}so{\k26}�a{\k18}r� {\k21}con {\k24}tu {\k24}re{\k34}gre{\k72}so

I'll attach you the txt file. Daddy Yankee - La despedida.txt

Maybe I should add that I use the pipe command in Linux to save the output from the script to a file:

ultrastar2ass myfile.txt > myfile.ass
AxelTerizaki commented 2 weeks ago

Oh, thanks for opening an issue, I'll try looking into it as soon as I can. Also thanks for providing a file to work with. I'm not sure how I'll make this work as encoding problems are quite a pain. I think the original .txt file needs to be converted to utf-8 (like with iconv) before being processed by ultrastar2ass as it'll try to output to utf-8 by default and won't make an attempt at guessing the original file's encoding.

AxelTerizaki commented 2 weeks ago

Bumped version to 1.1.0 and published to npm. Hopefully it should work better for you now :)

henrydatei commented 2 weeks ago

Thanks for updating. Unfortunately I'm not able to use it because I don't have a binary to execute (to be fair, I'm not working with javascript and node/npm, so there is a high chance of me being stupid)

henryhaustein@edr06818 ~ % npm list -g
/Users/henryhaustein/.nvm/versions/node/v20.17.0/lib
├── corepack@0.29.3
├── npm@10.8.2
└── ultrastar2ass@1.1.0

henryhaustein@edr06818 ~ % ultrastar2ass
zsh: command not found: ultrastar2ass

It looks like I successfully installed ultrastar2ass in the latest version, but executing it (after restarting the terminal, etc.) it can't find a binary. I had an old version of npm and node on my system before and there everything works but I couldn't upgrade ultrastar2ass that's why I reinstalled everything and now nothing works anymore :(. Can you point me to the right direction on what I can do? Thx

AxelTerizaki commented 2 weeks ago

My apologies, I forgot something when I published version 1.1.0. I published a 1.1.1 on NPM which should solve your issue. Use | npm i -g ultrastar2ass` to install it, and it should work again just fine. :)

henrydatei commented 2 weeks ago

Thx it working now