Skip to content

Commit

Permalink
- Better ID3v2.3 UTF-16 sample
Browse files Browse the repository at this point in the history
- ID3v2 : Read cleaner values from UTF-16 encoded TXXX fields
  • Loading branch information
Zeugma440 committed Oct 22, 2017
1 parent bca160c commit d4276a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,5 @@ $RECYCLE.BIN/
/ATL/nuget_pack.bat
*.nupkg
*.nuspec
/ATL.test/Resources/MP3/Folder.jpg
/ATL.test/Resources/MP3/AlbumArtSmall.jpg
Binary file modified ATL.test/Resources/MP3/id3v2.3_UTF16.mp3
Binary file not shown.
4 changes: 4 additions & 0 deletions ATL/AudioData/IO/ID3v2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@ private void readFrames(BufferedBinaryReader source, TagInfo tag, long offset, R
string[] tabS = strData.Split('\0');
Frame.ID = tabS[0];
strData = tabS[1];

// If unicode is used, there might be BOMs converted to 'ZERO WIDTH NO-BREAK SPACE' character
// (pattern : TXXX-stuff-BOM-ID-\0-BOM-VALUE-\0-BOM-VALUE-\0)
if (1 == encodingCode) strData = strData.Replace("\uFEFF", "");
}
else
{
Expand Down

0 comments on commit d4276a4

Please sign in to comment.