judwhite / IdSharp

.NET ID3 Tagging Library
http://www.idsharp.com
MIT License
54 stars 22 forks source link

value encoding by TXXX-Frames #2

Closed altemade closed 8 years ago

altemade commented 12 years ago

Hi Jud, very good tagging framework!

But I have a problem: I'm trying to show the musicbrainz tag's another program has written to an mp3, but there is a problem with the encoding. The TXXX frame is in Unicode, the description is read correctly, but the value wil only read hard-coded as ISO88591. In my opinion, it makes sense that the value is read from the text frame in the specified encoding.

Here's the code fragment: TXXXFrames.cs: ... public override void Read(TagReadingInfo tagReadingInfo, Stream stream) { _frameHeader.Read(tagReadingInfo, ref stream); if (_frameHeader.FrameSizeExcludingAdditions > 0) { TextEncoding = (EncodingType)stream.Read1(); int bytesLeft = _frameHeader.FrameSizeExcludingAdditions - 1; Description = ID3v2Utils.ReadString(TextEncoding, stream, ref bytesLeft);

//Bugfix 2012-04-08 alte Made, was: Value = ID3v2Utils.ReadString(EncodingType.ISO88591, stream, bytesLeft); Value = ID3v2Utils.ReadString(TextEncoding, stream, bytesLeft); } else ...

judwhite commented 12 years ago

Hi,

Thank you very much for finding this. I have committed your change.

judwhite commented 8 years ago

Fixed in https://github.com/judwhite/IdSharp/commit/3927fa60855702f585bf61529ffe9c0e7e1c0717