Menu

#33 Some bugs about the mp3 files of double bytes language

open
nobody
None
5
2003-06-24
2003-06-24
No

Because jd3lib can't read and write correctly with the
mp3 files using double bytes languages, I do the
following changes to fix them:

ID3v1Tag.java
private void readTag(RandomAccessFile raf) throws
FileNotFoundException, IOException
Line : 172
String tag = new String( buf, 0, TAG_SIZE );
->
String tag = new String( buf, 0, TAG_SIZE, "ISO-8859-1" );

public byte[] getBytes()
Line : 244 -
System.arraycopy( title.getBytes(), 0, tag,
bytesCopied, title.length() );
bytesCopied += TITLE_SIZE;
System.arraycopy( artist.getBytes(), 0, tag,
bytesCopied, artist.length());
bytesCopied += ARTIST_SIZE;
System.arraycopy( album.getBytes(), 0, tag,
bytesCopied, album.length() );
bytesCopied += ALBUM_SIZE;
System.arraycopy( year.getBytes(), 0, tag,
bytesCopied, year.length() );
bytesCopied += YEAR_SIZE;
System.arraycopy( comment.getBytes(), 0, tag, bytesCopied,
comment.length() );
->
try {
System.arraycopy( title.getBytes("ISO-8859-1"), 0,
tag, bytesCopied, title.length() );
bytesCopied += TITLE_SIZE;
System.arraycopy( artist.getBytes("ISO-8859-1"), 0,
tag, bytesCopied, artist.length());
bytesCopied += ARTIST_SIZE;
System.arraycopy( album.getBytes("ISO-8859-1"), 0,
tag, bytesCopied, album.length() );
bytesCopied += ALBUM_SIZE;
System.arraycopy( year.getBytes(), 0, tag,
bytesCopied, year.length() );
bytesCopied += YEAR_SIZE;
System.arraycopy( comment.getBytes("ISO-8859-1"), 0,
tag, bytesCopied,
comment.length() );
} catch (Exception ex) {
}

And there are still have some tag size problems in
ID3v2Tag.java and ID3v2Header.java, I think this may
occur in all language.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB