raw output instead of ISO-8859-1 or UTF-8

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
r.lucassen
Posts: 8
Joined: March 15th, 2018, 10:33 am

raw output instead of ISO-8859-1 or UTF-8

Post by r.lucassen » March 15th, 2018, 6:42 pm

Hello list,

In mpd.conf there is a setting "id3v1_encoding" which specifies to which encoding the "now playing" info must be converted. The standard of the source string is ISO-8859-1 as stated in the mpd.conf manpage.

But when using mpd for radio streams, the standard for encodings is that there are multiple standards :( I'm not a programmer, but is it, one way or another, feasible to get raw output with a "mpc current"? Which src file is responsible for this conversion?

I'd like to convert it externally, there is a nice php class for it. Very often I see question marks which already have been converted by mpd:

[..] Wichtigste Verb?ndete auf [..]

Richard.

max
Forum team
Posts: 825
Joined: January 15th, 2013, 3:43 pm

Re: raw output instead of ISO-8859-1 or UTF-8

Post by max » March 15th, 2018, 6:48 pm

r.lucassen wrote:
March 15th, 2018, 6:42 pm
setting "id3v1_encoding" which specifies to which encoding the "now playing" info must be converted
That's wrong.

r.lucassen
Posts: 8
Joined: March 15th, 2018, 10:33 am

Re: raw output instead of ISO-8859-1 or UTF-8

Post by r.lucassen » March 15th, 2018, 7:09 pm

I reread the manpage and indeed you're right. Sorry for that. But would it be possible to set it to "raw"? Just because one stream uses ISO-8859-15, the other utf-8 and antother windows-1252.

R.

max
Forum team
Posts: 825
Joined: January 15th, 2013, 3:43 pm

Re: raw output instead of ISO-8859-1 or UTF-8

Post by max » March 15th, 2018, 9:31 pm

No, there is no "raw". By definition, everything on the MPD protocol is UTF-8, and if some file doesn't have UTF-8, MPD will convert it to UTF-8. MPD clients just need to understand UTF-8 and nothing else.

r.lucassen
Posts: 8
Joined: March 15th, 2018, 10:33 am

Re: raw output instead of ISO-8859-1 or UTF-8

Post by r.lucassen » March 15th, 2018, 10:07 pm

You're absolutely right, but what if the input is uncertain? Try to load this m3u. The German stations have no problem (UTF-8) while the Finnish and Swiss stations will display question marks. I know it is not an mpd problem, nor an mpc problem, it's the same old ever lasting story of different standards, but I just try to find a solution for this annoying problem.

Code: Select all

#EXTM3U
#EXTINF:-1,Italy -- Venice Classic Radio
http://109.123.116.202:8020/stream
#EXTINF:-1,Finland -- Rondo Classic Klasu
http://stream.iradio.fi:8000/klasu-hi.mp3
#EXTINF:-1,Finland -- Rondo Classic Klasu Pro
http://stream.iradio.fi:8000/klasupro-hi.mp3
#EXTINF:-1,Switzerland -- Espace 2
http://stream.srg-ssr.ch/m/espace-2/mp3_128
#EXTINF:-1,Germany -- Mitteldeutscher Rundfunk MDR Klassik
http://mdr-284350-0.cast.mdr.de/mdr/284350/0/mp3/high/stream.mp3
#EXTINF:-1,Germany -- Norddeutscher Rundfunk NDR Kultur
http://ndr-ndrkultur-live.cast.addradio.de/ndr/ndrkultur/live/mp3/128/stream.mp3
Note: of course this only occurs when special characters are used.

R.

max
Forum team
Posts: 825
Joined: January 15th, 2013, 3:43 pm

Re: raw output instead of ISO-8859-1 or UTF-8

Post by max » March 16th, 2018, 8:27 am

These radio stations are broken. There's nothing MPD can do. (And this has nothing to do with ID3 tags.)

r.lucassen
Posts: 8
Joined: March 15th, 2018, 10:33 am

Re: raw output instead of ISO-8859-1 or UTF-8

Post by r.lucassen » March 18th, 2018, 10:43 am

Yes, you're right, these stations are broken. I even agree 200%. But unfortunately, it's reality. That's why I would like to get the "now playing" info unconverted so that I will be able to convert it externally. I don't want an auto-convert module built into mpd, that would mess up mpd. Just an option "do not convert streaminfo to UTF-8". Just to be able to correct stupidity of some stream server administrators.

R.

Post Reply