sometimes there is a problem with add favorite name

358 Views Asked by At

in some of the websites i have, when adding to favorite with IE button the name of the favorite that is auto filled in by the page title is sometimes not getting the name and insted it gets the url where the "/" is replaced by "-" and ":" is removed

what is the problem? the websites are hebrew or english, encoding is utf-8 or windows-1255...

1

There are 1 best solutions below

5
On BEST ANSWER

IE favorites are just files, specifically .url files. It is illegal, on Windows, to have a filename with certain characters in it. This includes the / and : characters. IE replaces them with a - rather than bothering the user about it.

The full list of illegal characters is: \ / : * ? " < > |

Only someone with the source code or more specific knowledge of IE than I can tell you the exact reason why it's not working for you. However, on your example page, you have a really long title: it's 396 characters long. MAX_PATH on Windows is 260 characters. My guess is that IE is falling into some error condition because your title is longer than anyone would reasonably expect a title to be (after all, the tab UI can only show about 50 characters). Since your title is too long, it's using the URL. Try shortening your title and see if that fixes the problem.

Update: I just ran a little experiment and it seems IE limits you to 128 characters (which means someone picked an arbitrary power of two and now you're stuck with it). Anything longer than 128 and IE uses the URL instead of the title.

You can also try using window.external.AddFavorite() in IE; I don't know how long of a title that will let you specify, but I suspect you'll always be limited to MAX_PATH.