From d4276a4233dcff947462c05c8e3c69cf51414db9 Mon Sep 17 00:00:00 2001 From: Z440 Date: Sun, 22 Oct 2017 14:48:18 +0200 Subject: [PATCH] - Better ID3v2.3 UTF-16 sample - ID3v2 : Read cleaner values from UTF-16 encoded TXXX fields --- .gitignore | 2 ++ ATL.test/Resources/MP3/id3v2.3_UTF16.mp3 | Bin 77303 -> 77303 bytes ATL/AudioData/IO/ID3v2.cs | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 1c4e27c7..69a34275 100644 --- a/.gitignore +++ b/.gitignore @@ -177,3 +177,5 @@ $RECYCLE.BIN/ /ATL/nuget_pack.bat *.nupkg *.nuspec +/ATL.test/Resources/MP3/Folder.jpg +/ATL.test/Resources/MP3/AlbumArtSmall.jpg diff --git a/ATL.test/Resources/MP3/id3v2.3_UTF16.mp3 b/ATL.test/Resources/MP3/id3v2.3_UTF16.mp3 index dc988b368d32951b966cb5960113b8e61b4099ef..b5f6f84535dd577d63dbf92efa4a8f02572aee88 100644 GIT binary patch delta 452 zcmXv}O-KS!5T0GPOlkc`p-TweOQVA5p!ow^Zi+3W5R!zf=Jsb2QGw8*OUHNVQn#*B zZHJ=3Iz^Yxkq5hV@fIOO_?oxj8{V65zL{@kUZ*K^nnF#Aj++2aRaL@?Sp;SPj&>(2 z07@zrK*DJdVW>bAO0a{kkqV*{jZ_v2kcT41k)$l6^CDf?P-z!{b`{Jrk)O%10G-8< z$(Vo|PDw5z$Ce1Pf&~QseS1pONeUZhH*^YaQ3Z{uK}kpE(Fu5isLsaHi27MH7MKDh zlgS{)$@n7~l4wzkX?G8pF*MPG;gl2saBU)6TFr)xD*GD!$xR8 zueq{`XhKU*^zHNdv)RRycgvEPZ=BZSx8+0aXW2^ikoABk4}*7PS1gj2=qH@5PA+Y) zq-K94A;%5*cHEOIr;ofi+XE+B?lUp|L`lPSAq=|#h~^HEbN3PPduH^U=gg%4`c`>; RWvFe@SYV-|)628NRKkRWGo1_lNeAT}~$2np~H2C|qzJcf{nhzKBq3&{8N z_jh5asHk8FarAKlim?L4o_A~ms&_R6ayfup$D)$V;u4UE5m1B;C=!{Pn8D!e@9PWX za|8LQdFc!xsl_FV4D}&EVW23`R%YK+1|ZK5ss|*`5CXIg$Ol;hw$n2NWF$L~8&ybm$n4YSiRgjtv6!?GRKf?nC0WUXCHwH#V z1_nkTWMKNwu-TX~n|bnFmIs?_SgV;fe`6PBn#{o!!OxJmf5tku9oaQGzhbz6%5u4? znI=Ey*)@3qZ{}nUKBdW;eCsD)=Q}@nDgVLAsRCOkOA79hV5ro!7Fk=uvFO9;mo4v3 ziKZV9vzh$!Kf~nLf^WGPx^v>5`xqYtavumS<*<_lInz#fa;LE25B63I-P%cb6O0@*1lyke6#7>RE#v}*ed09(j+%>V!Z diff --git a/ATL/AudioData/IO/ID3v2.cs b/ATL/AudioData/IO/ID3v2.cs index 957e3b5d..59a7b38e 100644 --- a/ATL/AudioData/IO/ID3v2.cs +++ b/ATL/AudioData/IO/ID3v2.cs @@ -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 {