jkramer / shell-fm

Lightweight console-based radio player for Last.FM radio streams.
227 stars 43 forks source link

Cyrillic input does not work #5

Open mkotsur opened 14 years ago

mkotsur commented 14 years ago

Attempt to input non-ASCII symbols (Cyrillic letters) results with something like this:

radio url> artist/<208><167><208><184><208><182>/similarartists

terminal encoding: UTF-8 program interprets those symbols like an empty string.

grampajoe commented 14 years ago

Has this been addressed? I've tried reproducing it with the latest build, and Cyrillic characters are usable with encoding set to UTF-8:

radio url> artist/Дельфин

Receiving Dolphin Radio.

Now playing "Turn Around" by Dolphin.

jkramer commented 14 years ago

There have been no changes related to radio input or encoding. Maybe the terminal settings were wrong? Can anyone still reproduce this problem or is it ok to close this issue?

grampajoe commented 14 years ago

I've actually found a closely related issue. If a station with non-ASCII characters is present in the history list, cycling through that entry causes part of the prompt (equal to the amount of non-ASCII characters) to be overwritten.

First step:

radio url> artist/Дельфин

Next step:

radiartist/nine inch nails

atr000 commented 14 years ago

Would it be possible to sanitize the output for this via an rc option? I had to sanitize via python on my output cmd since the display crashes with non-ascii/non-html (unfortunately)

jkramer commented 14 years ago

The input isn't aware of multibyte characters currently, that's why part of the prompt is deleted when cycling through the history ([number of bytes in string] backspaces are printed to delete the input). To solve this, the prompt code and the history code need to be changed to use wide character functions, which is pretty hairy.