Open meh111 opened 3 years ago
I wonder if this should be handled similarly to https://github.com/google/ExoPlayer/issues/6753
iso88591Decoder doesn't always throw CharacterCodingException. For example, it provides wrong decoded string from windows-1251 encoded bytes. So another try at the end won't work
I think there's some overlap between this and the heuristic charset detection for SubRip subtitles discussion in https://github.com/google/ExoPlayer/issues/3644#issuecomment-423931864.
In both cases I suppose there are two situations:
It seems likely that solving (1) (as requested here) is useful both in the ICY and SubRip case (and anywhere else we process text data with ambiguous or under-specced charset).
And equally if we did implement my CharsetDetector
-based suggestion for SubRip in https://github.com/google/ExoPlayer/issues/3644#issuecomment-565503504 then we could use it for ICY as well.
For this specific change to IcyDecoder: We would accept a high-quality PR adding the ability to pass the CharsetDecoder into its constructor.
Looking into IcyDecoder class, two hardcoder charset decoders:
private final CharsetDecoder utf8Decoder; private final CharsetDecoder iso88591Decoder;
please, provide customization for charset. I know many icecast streams that use other encodings. like this http://176.65.38.3:8000/blagovest provides metadata in windows-1251