One of them works correctly in all cases that I've tested. So it seems there are (at least) TWO distinct code pathways for converting Mac OS pathnames to URLs in FF 3.6.X. Note how the URL is truncated right where the '?' should appear. In both cases, FF reports "File not found", and the displayed URL is 'file:///Users/SomeUserName/SomeFolder/show'. FAILS if you use the Finder 'File > Open' menu item, either contextual or from the menu bar. FAILS if you double-click the file in Finder. ![]() Note how the '?' is escaped to '%3F'.įF 3.6.6 *cannot* open files with filenames like 'show?bug.html' if the Mac OS Finder is involved. In both cases, the displayed URL is 'file:///Users/SomeUserName/SomeFolder/show%3Fbug.html'. Works if you drag-n-drop the file onto an open FF window. Works if you use the FF 'File > Open File' menu item. If anyone can add a stringByAddingPercentEscapesUsingEncoding it would be helpful.Ī couple more thoughts, then I'm going to stop bothering you folks.įF 3.6.6 *can* open files with filenames like 'show?bug.html'. I don't have commit rights on Mozilla, but more I don't have much experience with this product. That method is expected to "Returns a representation of the receiver using a given encoding to determine the percent escapes necessary to convert the receiver into a legal URL string." (see :) On the string before you pass it to a method expecting a URL. Try using the NSString method -stringByAddingPercentEscapesUsingEncoding Note that ‘%’ escapes are translated via UTF-8. This method expects URLString to contain any necessary percentĮscape codes. > No, that isn't included in Firefox 3.5.xĪccording to the NSURL documentation for +URLWithString: ![]() The commit is dated Thu Apr 09 2009, didn't we use this code in Firefox 3.5.x?
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |