--- src/org/blinkenlights/jid3/io/TextEncoding.java 2008-05-27 11:23:03.000000000 -0700 +++ src/org/blinkenlights/jid3/io/TextEncoding.java 2008-05-26 10:39:01.000000000 -0700 @@ -91,7 +91,7 @@ case (byte)0x00: return "ISO-8859-1"; case (byte)0x01: - return "Unicode"; + return "UTF-16"; default: return null; // can't happen because we control construction of this object } --- src/org/blinkenlights/jid3/test/AllTests.java 2008-05-27 11:23:03.000000000 -0700 +++ src/org/blinkenlights/jid3/test/AllTests.java 2008-05-27 11:11:32.000000000 -0700 @@ -44,7 +44,7 @@ public class AllTests extends TestCase { // set root path for testing, so tests can find the test files - public static String s_RootPath = "c:/work/jid3/test_data/"; + public static String s_RootPath = "./test_data/"; public static void main(String[] args) { @@ -134,7 +134,7 @@ } // a 'visit list' was created by our visitor, recording which frames were visited, so we can compare - if ( ! oTestID3Visitor.getVisitList().equals("3=DS+uw_PsKMr(VT$ICBUtvNyEzRL)W[QJO6*-")) + if ( ! oTestID3Visitor.getVisitList().equals("3rstuvwyzBCDEIJKLMNOPQRSTUVW$()_=+[6*-")) { fail("Unexpected resulting visit list: " + oTestID3Visitor.getVisitList()); } --- src/org/blinkenlights/jid3/test/ID3V2Test.java 2008-05-27 11:23:03.000000000 -0700 +++ src/org/blinkenlights/jid3/test/ID3V2Test.java 2008-05-26 10:39:01.000000000 -0700 @@ -540,7 +540,7 @@ oTALB.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.setTALBTextInformationFrame(oTALB); - String sPrefix = "ID3ATALB7abcdefghijklmnopqrstuvwxyz"; + String sPrefix = "ID3ATALB7abcdefghijklmnopqrstuvwxyz"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -744,7 +744,7 @@ oTIME.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.setTIMETextInformationFrame(oTIME); - String sPrefix = "ID3TIME0805"; + String sPrefix = "ID3TIME0805"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1258,7 +1258,7 @@ oTXXX = new TXXXTextInformationID3V2Frame("description2", "information2"); oID3V2_3_0Tag.addTXXXTextInformationFrame(oTXXX); - String sPrefix = "ID3aTXXX3descriptioninformationTXXXdescription2information2"; + String sPrefix = "ID3aTXXX3descriptioninformationTXXXdescription2information2"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1464,7 +1464,7 @@ oWXXX = new WXXXUrlLinkID3V2Frame("another description", "http://www.grebenc.ca"); oID3V2_3_0Tag.addWXXXUrlLinkFrame(oWXXX); - String sPrefix = "ID3vWXXX*another descriptionhttp://www.grebenc.caWXXX8descriptionhttp://jid3.blinkenlights.org"; + String sPrefix = "ID3vWXXX*another descriptionhttp://www.grebenc.caWXXX8descriptionhttp://jid3.blinkenlights.org"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1519,7 +1519,7 @@ oID3V2_3_0Tag.addAPICFrame(oAPIC); oID3V2_3_0Tag.addAPICFrame(new APICID3V2Frame("image/jpeg", APICID3V2Frame.PictureType.FrontCover, "Front cover.", new byte[] { 0x05, 0x04, 0x03, 0x02, 0x01 })); - String sPrefix = "ID3bAPIC/image/pngArtist image.APICimage/jpegFront cover."; + String sPrefix = "ID3bAPIC/image/pngArtist image.APICimage/jpegFront cover."; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1556,7 +1556,7 @@ oID3V2_3_0Tag.addCOMMFrame(oCOMM); oID3V2_3_0Tag.addCOMMFrame(new COMMID3V2Frame("rus", "next description", "next actual text")); - String sPrefix = "ID3{COMMBengshort descriptionactual textCOMM%rusnext descriptionnext actual text"; + String sPrefix = "ID3{COMMBengshort descriptionactual textCOMM%rusnext descriptionnext actual text"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1605,7 +1605,7 @@ oCOMR.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.setCOMRFrame(oCOMR); - String sPrefix = "ID3tCOMRjcad12.9925250101http://jid3.blinkenlights.orgsellerdescriptionimage/png"; + String sPrefix = "ID3tCOMRjcad12.9925250101http://jid3.blinkenlights.orgsellerdescriptionimage/png"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1717,7 +1717,7 @@ oGEOB = new GEOBID3V2Frame("image/jpeg", "filename2", "another content description", new byte[] { 0x05, 0x04, 0x03, 0x02, 0x01 }); oID3V2_3_0Tag.addGEOBFrame(oGEOB); - String sPrefix = "ID3GEOB7image/jpegfilename2another content descriptionGEOBNimage/pngfilenamecontent description"; + String sPrefix = "ID3GEOB7image/jpegfilename2another content descriptionGEOBNimage/pngfilenamecontent description"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1779,7 +1779,7 @@ oIPLS.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.setIPLSFrame(oIPLS); - String sPrefix = "ID3IPLSinvolvement1person1involvement1person2involvement2person3"; + String sPrefix = "ID3IPLSinvolvement1person1involvement1person2involvement2person3"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -1871,7 +1871,7 @@ oOWNE.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.setOWNEFrame(oOWNE); - String sPrefix = "ID3*OWNE cad12.3420000102seller"; + String sPrefix = "ID3*OWNE cad12.3420000102seller"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -2063,7 +2063,7 @@ oSYLT.addSyncEntry(new SYLTID3V2Frame.SyncEntry("def", 5)); oID3V2_3_0Tag.addSYLTFrame(oSYLT); - String sPrefix = "ID3SYLTengcontent descriptoronetwothreeSYLT*rusanother descriptionabcdef"; + String sPrefix = "ID3SYLTengcontent descriptoronetwothreeSYLT*rusanother descriptionabcdef"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -2141,7 +2141,7 @@ oUSER.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.setUSERFrame(oUSER); - String sPrefix = "ID3*USER engTerms of use."; + String sPrefix = "ID3*USER engTerms of use."; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -2177,7 +2177,7 @@ oUSLT.setTextEncoding(TextEncoding.UNICODE); oID3V2_3_0Tag.addUSLTFrame(oUSLT); - String sPrefix = "ID3DUSLT:engcontent descriptorlyrics"; + String sPrefix = "ID3DUSLT:engcontent descriptorlyrics"; runTagVerifyTest(oID3V2_3_0Tag, sPrefix); } @@ -2599,7 +2599,7 @@ ID3Tag.useStrict(false); try { - File oSourceDir = new File("c:/temp/mp3"); + File oSourceDir = new File("test_data"); recurseDirectoryForMP3s(oSourceDir); } catch (Exception e) --- src/org/blinkenlights/jid3/v2/ID3V2Tag.java 2008-05-27 11:23:03.000000000 -0700 +++ src/org/blinkenlights/jid3/v2/ID3V2Tag.java 2008-05-27 11:09:51.000000000 -0700 @@ -50,7 +50,7 @@ protected boolean m_bCRCDataFlag; /** Mapping from frame ID to list containing frames. For frames that can only be used once. */ - protected Map m_oFrameIdToFrameMap = null; + protected SortedMap m_oFrameIdToFrameMap = null; /** Default padding for ID3 v2 frames, if not specified. 16 bytes, because Winamp does not read the last * frame when there isn't at least 6 bytes of padding following it in a tag. */ @@ -72,7 +72,7 @@ m_bUnsynchronizationUsedFlag = bUnsynchronizationUsedFlag; m_bExtendedHeaderFlag = bExtendedHeaderFlag; m_bExperimentalFlag = bExperimentalFlag; - m_oFrameIdToFrameMap = new HashMap(); + m_oFrameIdToFrameMap = new TreeMap(); //HACK: Default padding of 16 bytes, because Winamp doesn't seem to see the last frame in a v2 tag // when there is less than 6 bytes of padding. (???) m_iPaddingLength = s_iDefaultPaddingLength;