JeevanJames / Id3

Library to read, modify and write ID3 & Lyrics3 tags in MP3 files. Provides an extensible framework for retrieving ID3 information from online services.
Apache License 2.0
41 stars 17 forks source link

Unicode not supported #25

Open lawrencepa opened 4 years ago

lawrencepa commented 4 years ago

I call "WriteTag" with unicode characters and the MP3 title was updated with "???:????". Apparently it does not support unicode characters.

spottedmahn commented 4 years ago

I've seen Unicode code in the code so there must be some type of support😃. Can you upload the file?

Can you share more details? What's the current title value?

alucard-o commented 2 years ago

I can reproduce this bug.
Example of code below :

tag.Title = "Kid Chameleon — Box ✅ Manual ✅";
[...]
mp3.WriteTag(tag, WriteConflictAction.Replace);

The result text in the tag is :
Kid Chameleon - Box ? Manual ? It should be :
Kid Chameleon — Box ✅ Manual ✅

shamork commented 1 year ago

I can reproduce this bug. Example of code below :

tag.Title = "Kid Chameleon — Box ✅ Manual ✅";
[...]
mp3.WriteTag(tag, WriteConflictAction.Replace);

The result text in the tag is : Kid Chameleon - Box ? Manual ? It should be : Kid Chameleon — Box ✅ Manual ✅

I've solved your problem! @alucard-o

tag.Title = "Kid Chameleon — Box ✅ Manual ✅";//❤ implicitly converted string to TextFrame, which EncodingType is default encoding.❤

/***❤❤important line❤❤***/
tag.Title.EncodingType = Id3TextEncoding.Unicode;
/***❤❤important line❤❤***/

mp3.WriteTag(tag, WriteConflictAction.Replace);
alucard-o commented 1 year ago

Oh thanks @shamork ! I forgot to update this issue, i solved it the same way some time ago.

tag.Title = new Id3.Frames.TitleFrame()
{
    EncodingType = Id3TextEncoding.Unicode,
    Value = "Kid Chameleon — Box ✅ Manual ✅"
};