0

I'm running following code:

TagLib.File f = TagLib.File.Create(path);
f.Tag.AlbumArtists = f.Tag.Artists = new string[] { "артист" };
f.Tag.Title = "песня";
f.Save();

Both id3v1 and id3v2 tags are set, but only id3v2 tag is set properly. v1 tag shows me only "????????" question marks instead of letters.

Can someone help me? Thanks!

VladL
  • 12,769
  • 10
  • 63
  • 83
  • ID3v1 doesn't support Unicode, which itself makes non-ASCII characters problematic at best, and clearly, TagLib# isn't using an encoding compatible with Russian text. I'd suggest you stick with pure ID3v2. – Michael Madsen Sep 18 '12 at 19:25
  • But modifying the ID3v1 tag with winamp saves the Russian text without any problems and even TagLib# can read it properly. Maybe there is any possibility to do it? – VladL Sep 18 '12 at 19:39
  • Winamp works because it assumes your native system codepage (Windows-1251), and presumably, TagLib# does the same while reading. However, on e.g. my system, that same file wouldn't load correctly, because my system is configured differently (it would use Windows-1252, resulting in a nonsensical sequence of accented characters). That's why v1 isn't useful once you go beyond basic ASCII, and virtually everything supports v2 anyway (and the few things that might not, probably can't display your Russian characters anyway). – Michael Madsen Sep 18 '12 at 19:48
  • Thanks Michael for your explanation. Since TagLib# writes v1 tag automatically it could be useful to choose proper encoding or even use the system encoding setting for non-unicode characters. That's what I meant with "possibility to do it". Otherwise it looks as expected for ASCII chars and ugly for non-ascii. – VladL Sep 18 '12 at 20:04

2 Answers2

3

ID3v1 is an old standart and support only ANSI characters.

See more information here.

Gustavo F
  • 2,071
  • 13
  • 23
1

Unfortunatley, TagLib makes some encodings inside. I've testen over 100 mp3 files. And I'm real confused: why some of them I can update with CYR texts inside of TAGs, but the same time some of them have "?????". The same code!

I've combined Tags and Properties - nothing differed. But! Some files have 2 Tags "collections": ID3v2, ID3v2 and ID3v1. In this case I can change Tags with CYR chars. What that means "ID3v2, ID3v2" I've didn't undrestood. Why 2 same - no answer.

I have a look some codes of TagLib# and fond there "this.encoding = ...". After that I've stoped analyze "why" and "where".

Vlad L, just use Translit for those files. I thing TagLib# detect charset and gives you no chance to change it (1251 != 1252 etc.)

j0k
  • 22,600
  • 28
  • 79
  • 90
Anri
  • 31
  • 1