\-#-\

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
markfilipak
Posts: 7
Joined: Sat Aug 09, 2014 8:08 pm

\-#-\

Post by markfilipak »

Windows 10
TP 7.6.4

There's something about a directory path that includes a directory named '-#-' that prevents 'View in Web Browser' working.

This path
d:\D\Cinema\Mark's Cinema Guide\THE FILM TABLE\-#-\2001, A SPACE ODYSSEY [1968] extraterrestrial first-contact drama.htm'
provokes a 404, whereas this path:
d:\D\Cinema\Mark's Cinema Guide\THE FILM TABLE\-C-\CAVE OF FORGOTTEN DREAMS [2010] prehistoric cave art documentary.htm
works.

Both work when double-clicked in a file manager.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

# has a special meaning in an URL, everything after the # is treated as "fraction identifier", i.e. it defines which part of the document specified before the # should be shown.


My opinion: file names should contain ASCII letters a to z, digits, underscore, dash and dot. Nothing else.

In my experience, all other characters produce problems sooner or later. E.g. space might be treated as a separator, e.g.
textpad.exe foo bar
might treat the filename "foo bar" as two separate files - you have to use quotes.
User avatar
AmigoJack
Posts: 596
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

  1. Neither Textpad nor Windows is the culprit - we're talking about an internet browser (which is yet unknown to this topic).
  2. It's a file: URI, not a URL, hence the "#" in question should not be interpreted as HTML anchor. At this point your internet browser is doing it wrong.
  3. RFC 8089 neither knows anchors, nor mentions "#" as disallowed. However, it uses the term "path-absolute", being defined in RFC 3986, and that one does not allow a "#" in the URI components. In such a case the character should be percent-encoded.
Conclusion:
  1. Try opening (in the internet browser)
    d:\D\Cinema\Mark's Cinema Guide\THE FILM TABLE\-%23-\2001, A SPACE ODYSSEY [1968] extraterrestrial first-contact drama.htm
    or more appropriately
    file:///d:/D/Cinema/Mark's Cinema Guide/THE FILM TABLE/-%23-/2001, A SPACE ODYSSEY [1968] extraterrestrial first-contact drama.htm
    and it should "work".
  2. The "View in web browser" should be adapted to either hand over a URI with the file: scheme to being with, and it should in doubt percent-encode characters in the URI components.
Post Reply