Bug report: Jukes 4 is writing incorrect XSPF files

Feature Requests, Comments, Bugs, and Suggestions on the Jukes java jukebox.

Bug report: Jukes 4 is writing incorrect XSPF files

Postby Horvat » Wed Aug 01, 2007 7:20 am

I tried Jukes 4.1.0.35 to see how it handles XSPF files (I am trying
to write an XSPF plug-in for foobar2000, and I would like to make it
compatible with other software). It seems that Jukes is writing
incorrect XSPF files on Windows. I found three problems:

1. The duration of the tracks should be given in milliseconds, not
seconds as Jukes does currently.
http://xspf.org/xspf-v1.html#rfc.sectio ... 4.1.1.1.10

2. File URLs on Windows should be specified as

file:///C:/Documents%20and%20Settings/User/My%20Documents/Music/file.mp3

and not as

file:/C:/Documents%20and%20Settings/User/My%20Documents/Music/file.mp3

(Note the three slashes after "file:")
Read about file URLs here: http://www.cs.tut.fi/~jkorpela/fileurl.html

3. If I understand correctly, non-ascii characters should be
percent-encoded in URLs.
http://rfc.net/rfc3986.html#s2.1.
http://rfc.net/rfc3986.html#s2.5.

I noticed that the character ă (a with breve, see
http://en.wikipedia.org/wiki/%C4%82 ), which appeared in the title of
a song, was not encoded correctly to UTF-8 when it was written to the
XSPF playlist.
Horvat
 

Postby Melloware » Wed Aug 01, 2007 12:21 pm

OK my responses to your bug report:

1. This has been corrected in 4.1.0.36 and will be in milliseconds.

2. I am using the java File.toURI().toURL() method which always returns files in that format. The Javadoc for File.toURI says that the output of this is platform dependent.

3. I actually found it is a bug in Java decoding the ă properly in URLs. Here is the bug.

http://bugs.sun.com/bugdatabase/view_bu ... id=4273532
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11020
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Postby Guest » Thu Aug 02, 2007 1:43 am

Melloware wrote:OK my responses to your bug report:

1. This has been corrected in 4.1.0.36 and will be in milliseconds.

Thanks!
2. I am using the java File.toURI().toURL() method which always returns files in that format. The Javadoc for File.toURI says that the output of this is platform dependent.

It turns out that using "file:/" instead of "file:///" might not be wrong after all. However, non-ascii characters should still be encoded as UTF-8 and %-escaped propery, i.e. no accented characters should appear in the final URL. I am not familiar with Java at all, but after reading
http://java.sun.com/j2se/1.4.2/docs/api ... t/URI.html
it seems to me that using File.toURI().toASCIIString() might do this. Could you please try it?

3. I actually found it is a bug in Java decoding the ă properly in URLs.


Sorry, I was not very clear about this. This is a separate issue from URL encoding. The ă character appeared in the metadata for a song. To reproduce the problem, do the following:

1. Insert the ă character into the title of a song using Jukes.
2. Export a playlist containing that song to XSPF.
3. Check the resulting file with a text editor: The character should have been encoded to UTF-8 as 0xC4, 0x83, but it was written as 0xC4, 0x3F, which is not valid UTF-8, therefore most text editors will try to display the file as Latin-1.

I tried this on WinXP, JRE 6 update 2.
Guest
 

Postby Melloware » Thu Aug 02, 2007 11:45 am

OK it looks like:

1. toAsciiString() fixed the problem with the URL. Thank you for finding that.

2. That looking through the finer print in the Dom4J docs showed me I was not encoding the XML to UTF-8 properly. I think I have that worked out now in 4.1.0.36.

Thanks and let me know if that fixes your problems!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11020
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA


Return to Jukes

Who is online

Users browsing this forum: No registered users and 1 guest