0

I'm using TagLib to read ID3 data.

I can't read data properly from ID3 tag when they contain cyrillic characters. (I'm getting something like "²íòó³ö³ÿ").

Here is my code:

TagLib.File f = TagLib.File.Create(songFileName);
string title = f.Tag.Title;

What have I missed?

BIKTOP
  • 123
  • 1
  • 2
  • 7

1 Answers1

-1

You can try to use this method to process your strings. It works fine for me when the string isn't empty and contains Russian or English letters.

    public string ConvertToUtf8(string unknown)
    {
        return new string(unknown.ToCharArray().
            Select(x => ((x + 848) >= 'А' && (x + 848) <= 'ё') ? (char)(x + 848) : x).
            ToArray());
    }

Source

Sleepy Panda
  • 458
  • 3
  • 9