[TW5] Why have static pages such a different url encoding?

97 views
Skip to first unread message

Tobias Beer

unread,
Oct 1, 2015, 3:50:13 PM10/1/15
to TiddlyWiki
For example,

Taking tiddler Working with TiddlyWiki as an example...

This is what the permalink looks like:
  http://tiddlywiki.com/#Working%20with%20TiddlyWiki

...and this is what the link to the static page looks like...
  http://tiddlywiki.com/static/Working%2520with%2520TiddlyWiki.html

Obviously static links are in a subdirectory, but how come
the tiddler titles have a different rather weird encoding?

Searching for %2520 suggests it's a case of double-encoding.
Can we do away with it?

Best wishes,

— tb

Siniy-Kit

unread,
Oct 4, 2015, 1:04:05 PM10/4/15
to TiddlyWiki

as far as i understand it is standart.    <$view field="title" format="doubleurlencoded"/>

четверг, 1 октября 2015 г., 22:50:13 UTC+3 пользователь Tobias Beer написал:

Jeremy Ruston

unread,
Oct 4, 2015, 5:19:21 PM10/4/15
to tiddl...@googlegroups.com
Hi Tobias

Anything to do with encodings is liable to be a little mindbending.

The key here is to look at the actual static files themselves, rather than the URLs that are used to access them. For example, the link to the static tiddler  http://tiddlywiki.com/static/Working%2520with%2520TiddlyWiki.html ends up at the following file:


Again, there’s the double, encoding, but if you visit the URL you’ll see the file path given as jermolene.github.io/static/Working%20with%20TiddlyWiki.html.

What’s going in is that:

a) TiddlyWiki uses URI encoding to ensure that troublesome filename characters like the colon and slash are safely escaped
b) The browser uses a further level of URI encoding to encode unsafe URI characters like the percentage sign. This encoding affects the URI, not the underlying file path

As I say, it’s mindbending stuff.

Best wishes

Jeremy.



-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/177b48d3-7cae-4290-9ba8-af3a98fef151%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages