On Sep 9, 2010, at 16:48, Adam R. Maxwell wrote: > > On Sep 9, 2010, at 2:09 AM, Christiaan Hofman wrote: > >> Perhaps we can just do the old version for strings we know are coming from a >> DOI (like a Doi field). > > That's probably the best way to do it, and in that case, all "#" should be > escaped as well (and there's no need to unescape beforehand). As you pointed > out, that wouldn't have been handled correctly before, which might explain a > few of the broken DOI links that I have :/. This brokenness comes from > trying to handle DOI and URL with the same code...but I'm not sure why we > were normalizing URLs in general, since they should already be escaped.
I also think that URL fields, which are just plain text, could contain invalid characters like spaces, note that we also use the cleaning method when the user enters the URL in a text field. So I've now implemented it as follows: when interpreting URL from user input or from a field value, just escape all non-URI characters except for # and % (this leaves existing escapes intact). When interpreting the Doi field, first escape all non-URI characters from the DOI string before attempting to create a URL. Christiaan ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ Bibdesk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-users
