Closed karma88 closed 10 years ago
You got any stream for testing purposes?
Yep, currently non-ASCII data is ignored by the ICY metadata parser, see: https://github.com/muhku/FreeStreamer/blob/master/astreamer/http_stream.cpp#L410
How can i activating this for support it ..?
@karma88: You could try removing the following lines from the code, which filter out the non-ASCII characters. So beginning from line 426, https://github.com/muhku/FreeStreamer/blob/master/astreamer/http_stream.cpp#L426
Remove this block:
if (c < 32 || c > 126) {
continue;
}
when i remove this block the text label leave blank...
Right, then there are probably some bytes, which break the string encoding. Any zero bytes will truncate the string at least. To debug this further, put a breakpoint to the previously mentioned point and output the metadata bytes.
I got the issue reproduced with the following stream: http://www.voice.fi/nettiradio/voice.m3u
Ü,Ä Ö etc. are missing. Removing the ASCII filtering breaks the string encoding so a bit more effort would be needed to handle this correctly.
I'am on it.
Closing this due to @Leandros' pull request #18 merged to master.
@karma88: Please make sure your tree of FreeStreamer has the commit 0061300fa815eb9567fc070ab3249a8cde3cede7
One more commit needed for the encoding to work: 20bf211c1c40b41473aa75816e7cd503109a7dab
Please notice that the metadata encoding is not probed, so we assume now that the metadata is always encoded in UTF8. See: https://github.com/muhku/FreeStreamer/blob/master/astreamer/http_stream.cpp#L406 This is not ideal but seems to work well enough in practice.
Note that from now on, I would prefer to use CFString instead of std::string (though no hurry for any quick changes).
It does work perfectly with wide string. Though, as I said in the request, it isn't the most elegant solution.
However, any non UTF-8 string will return NULL. Checking for that could be a good idea.
@Leandros This is what I got with std::wstring and UTF8 encoded metadata: https://dl.dropboxusercontent.com/u/995250/Screen%20Shot%202013-12-10%20at%2010.18.24.png
This is how it looks like after doing the encoding with CFStringCreateWithBytes(): https://dl.dropboxusercontent.com/u/995250/Screen%20Shot%202013-12-10%20at%2013.43.00.png
So for some reason CFStringCreateWithBytes() resulted the correct encoding with the stream I was testing with.
I have some ideas for probing the metadata encoding so let's see if that is needed at some point. Feel free to share if you have some ideas related to that. :-)
The metadata from the songs does not support the following letters: Ü,Ä Ö