Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Streaming media encoding patch not working in 1.4 (Read 2812 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Streaming media encoding patch not working in 1.4

Streaming titles that have non-latin characters are often displayed incorrectly due to some encoding issues. There's a component named "HTTP SJIS Patch" that used to fix this issue in 1.3. In 1.4 however it stopped working. It does not give an error or anything, the characters are just no longer converted to the format they're supposed to be in.
Any ideas/planned fixes for this?
A stream that only has russian titles for testing purposes, if you need one:
Code: [Select]
http://stream128.melodiafm.spb.ru:8000/melodia128

Re: Streaming media encoding patch not working in 1.4

Reply #1
Maybe the Developers will help us.
Here is the link to the component: foo_http_sjis_patch2
Why did he stop working in v1.4 fb2k? Maybe some of the coders have ideas.

@Pollux88, thanks for the good URL radio :)

Re: Streaming media encoding patch not working in 1.4

Reply #2
Looks like they've rolled out version 1.05 of the patch.
https://github.com/k725/foo_http_sjis_patch4/releases/
However, it still does not appear to work for russian encoding
Edit: seems like it's actually an old version made before Foobar 1.4 was released, it's just hard to keep track of Japanese components.

Re: Streaming media encoding patch not working in 1.4

Reply #3
Also, I just checked, the latest version does not help with russian characters even in v1.3 foobar. It turns russian characters into japanese. 1.02 works just fine though.

Re: Streaming media encoding patch not working in 1.4

Reply #4
I think, here needed someone who knows how to use MultiByteToWideChar function.
Experts, please look the source code, what could be the reason?
@Yirkha made similar component Chacon earlier. But he was not active for a long time :(

Re: Streaming media encoding patch not working in 1.4

Reply #5
In our case it is necessary to convert characters from the standard Windows-1251 to UTF-16 (Unicode).
And here you can see the result: https://2cyr.com/decode/

Re: Streaming media encoding patch not working in 1.4

Reply #6
There's sort of a solution. If you install AGOpus font and use it in the playlist, the titles display normally. Problem is - AGOpus is a very ugly font for a playlist. I guess what it does is replace the diacritical marks with corresponding cyrillic characters from the necessary codepage, so we can probably augment any existing font in similar manner.  However, this messes up any diacritical marks (é, ç, ñ, etc.) present  in legit titles. So this is a poor solution one way or the other.

Re: Streaming media encoding patch not working in 1.4

Reply #7
I've made an altered version of Segoe UI and it's much less ugly. The regular version is just plain Segoe UI that will not mess your diacritics (and also will not fix the messed up cyrillics in streaming URL titles). The Italic version is actually not Italic, but regular Segoe UI with replaced characters that will fix the messed up cyrillics in streaming URL titles (and also mess up diacritics in regular titles).
El_playlist can actually use different fonts within the playlist, so we can set it up to only use altered font for streaming titles with something like
$puts(track.text,$if(%isplaying%,$if($stricmp($left(%path%,4),http),$font(SegoeFoobar,9,Italic)%artist% - %title%, $font(Segoe UI,9)%artist% - %title%)))
So we have something resembling a half decent solution. But it's actually still piss-poor, because
a) there's no way to unmess the window title
b) not sure if streaming titles can contain diacritics, but if they can those would be messed too
c) anything that can't display different fonts or font styles won't work (pretty much all components, like lyrics display, etc). And also El_playlist is complicated as HELL (but also pretty powerful).
Edit: updated the font, it had some misplaced characters.

Re: Streaming media encoding patch not working in 1.4

Reply #8
Actually, guys from Foobar2000.ru came up with a simpler and much more universal workaround.
Code: [Select]
$if($stricmp($left(%path%,4),http),$replace([%artist%' - '][%album%' - ']%title%,à,а,á,б,â,в,ã,г,ä,д,å,е,¸,ё,æ,ж,ç,з,è,и,é,й,ê,к,ë,л,'ì',м,í,н,'î',о,ï,п,ð,р,ñ,с,ò,т,ó,у,ô,ф,õ,х,ö,ц,÷,ч,ø,ш,ù,щ,û,ы,ý,э,þ,ю,ü,ь,ÿ,я,À,А,Á,Б,Â,В,Ã,Г,Ä,Д,Å,Е,¸,Ё,Æ,Ж,Ç,З,È,И,É,Й,Ê,К,Ë,Л,Ì,М,Í,Н,Î,О,Ï,П,Ð,Р,Ñ,С,Ò,Т,Ó,У,Ô,Ф,Õ,Х,Ö,Ц,×,Ч,Ø,Ш,Ù,Щ,Ý,Э,Þ,Ю,ß,Я,Ü,Ь,Û,Ы,Ÿ,Я),[%artist%] -
[%title%])
Should work with any playlist and window title too.
It still leaves other abovementioned problems though. I'd much rather Foobar could work with different encodings out of the box.

Re: Streaming media encoding patch not working in 1.4

Reply #9
In theory, there is a function $ansi(%title%) which should solve this issue. But seems that does correctly only for Latin characters.
It remains to hope that the developers still pay attention to this problem and will improve this feature for fb2k.

Re: Streaming media encoding patch not working in 1.4

Reply #10
In practice, $ansi() just removes the diacritics.
Edit: oh, too late

Re: Streaming media encoding patch not working in 1.4

Reply #11
@Peter, you make us happy!
Thank you for that!
 :)

 

Re: Streaming media encoding patch not working in 1.4

Reply #12
Sergey77:  did you find a fix for this?  I wasn't clear on your reply thanking Peter;  is that because it is fixed in the new beta 1.4.1 that I have yet to install, or did you find a solution on your own?  I listen to several stations that send track names in Cyrillic characters and so have had the same problem with the messed up encoding.

Re: Streaming media encoding patch not working in 1.4

Reply #13
Sergey77:  did you find a fix for this?  I wasn't clear on your reply thanking Peter;  is that because it is fixed in the new beta 1.4.1 that I have yet to install, or did you find a solution on your own?  I listen to several stations that send track names in Cyrillic characters and so have had the same problem with the messed up encoding.
@sveakul,
I installed fb2k v1.4.1 beta1 only, nothing else more.
And first of all I checked this radio: http://stream128.melodiafm.spb.ru:8000/melodia128
I see the issue has been fixed. And now everything works fine, at least this radio. Maybe for some other net radio this issue continues.
We can check and report here.

Re: Streaming media encoding patch not working in 1.4

Reply #14
@sveakul , i guesss, that, if your windows locale is not russian/cyrillic, you should manually set correct correct Codepage number in File->Preferences->Advanced->Networking->Codepage for ShoutCast metadata

Re: Streaming media encoding patch not working in 1.4

Reply #15
Thanks Sergey77 and Rollin for your replies!

While I did install 1.4.1b1, the no-Cyrillic problem persisted.  Not having checked closely enough to find the new Codepage option in Advanced that Rollin pointed out (thanks!), I did some googling and found that by setting my "Language for non-Unicode programs" to Russian via the Windows 7 control panel I was good to go, and now get proper artist/track displays for Cyrillic in Foobar and other players.  What's cool about the 1.4.1b1 feature Rollin mentioned is that with Foobar I can change to other codepages as well if ever needed;  add that to the return of network buffering and yep to quote Sergey77, "Peter, you make us happy!" :)

Re: Streaming media encoding patch not working in 1.4

Reply #16
Sergey77:  Just a follow up.  After some testing I can confirm that even after changing the Windows 7 system locale to Russian, in the case of the station Pollux88 and you mentioned, Radiocanal Melodia,  characters continued to be garbled in Foobar 1.4 final (but not for other Cyrillic senders like Glavnoe Radio), although it was fixed in my other players for all of them.  In 1.4.1beta1, no problem anymore with that first station, which confirms that there was indeed an issue with Foobar and that specific example that was fixed for 1.4.1b1 regardless of system locale setting.  За здоровье! :)

Re: Streaming media encoding patch not working in 1.4

Reply #17
А radio station with incorrect display of dynamic metadata characters was again detected: http://listen.vdfm.ru:8000/dacha
Changes in the "Codepage for ShoutCast metadata" settings do not affect. Developers, please pay attention to this. (foobar2000 v1.4.4)
Thanks!


Re: Streaming media encoding patch not working in 1.4

Reply #19
I can't find any player that can display its metadata properly. So it seems that metadata just completely broken.
Perhaps you`re right. But on this site https://2cyr.com/decode/ this characters of that station encoding properly:
Code: [Select]
Ñ Äíåì Ðîæäåíèÿ
С Днем Рождения

Re: Streaming media encoding patch not working in 1.4

Reply #20
That appears to require Mojibake decoding capability, which implies that the wrong code page is already being turned into UTF-8 somewhere.