K
K
Kitoved2017-01-14 10:08:44
Java
Kitoved, 2017-01-14 10:08:44

How to get Russian-language song titles in IcyStreamMeta?

Hello everyone, I'm new to android programming, and programming in general. I'm using icystreammeta to get metadata from one of the internet radios. Faced such a problem that only the English text of the song titles is recognized, when the songs with the title are in Russian, some kind of scribbles are recognized. Googled all over the internet and couldn't find anything about it. Who understands this please help to solve the problem. Here is a piece of code from the icystreammeta class, I think the reason is hidden somewhere in the regular expressions. Tried to figure them out, to no avail.

public static Map<String, String> parseMetadata(String metaString) {
        Map<String, String> metadata = new HashMap();
        String[] metaParts = metaString.split(";");
        Pattern p = Pattern.compile("^([a-zA-Z]+)=\\'([^\\']*)\\'$");
        Matcher m;
        for (int i = 0; i < metaParts.length; i++) {
            m = p.matcher(metaParts[i]);
            if (m.find()) {
                metadata.put((String) m.group(1), (String) m.group(2));
            }
        }

Maybe you need to somehow change the line with regular expressions? Or leave everything as it is, but re-encode the resulting text into a different text encoding? How to do it right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kitoved, 2017-02-16
@Kitoved

Before displaying the received text in textview, I added text recoding. helped

O
one pavel, 2017-01-16
@onepavel

It seems that in this specified range [a-zA-Z] the Cyrillic alphabet does not fall
on the wiki using regular expressions
\w - An alphabetic or numeric character or an underscore
([\w]+) - perhaps it should be so

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question