]> sipb.mit.edu Git - ikiwiki.git/blob - doc/plugins/shortcut/discussion.mdwn
%W is not as weird as it looks at first glance
[ikiwiki.git] / doc / plugins / shortcut / discussion.mdwn
1 The plugin depends on [[mdwn]].  If you have
2 disabled [[mdwn]], to get [[shortcut]] work, you need
3 commit in a shortcuts.ext (ext is `rcs|creole|html|txt|etc`),
4 and edit/patch [[shortcut]].
5
6 Maybe use the `default_pageext` is better than hardcode .mdwn?
7
8 --[[weakish]]
9
10 > done, it will use `default_pageext` now --[[Joey]] 
11
12 ---
13
14 Instead of modifying the [[basewiki]]'s [[shortcuts]] file for local needs --
15 thus copying it at some point and losing continuity with upstream enhancements --
16 what about handling a `shortcuts-local.mdwn` or `shortcuts/local.mdwn` (if such
17 a file exists in the wiki), and additionally process that one.  Possibily a
18 conditional `\[[!inline]]` could be used.  --[[tschwinge]]
19
20 ----
21
22 The page says
23
24 > Additionally, %W is replaced with the text encoded just right for Wikipedia
25
26 with the implication that this is odd. However, it appears the escapes
27 actually mean:
28
29 =%s=
30     If every character in the string is in the Latin-1 range, encode each
31     character as a http %xx escape: ö -> %F6. If not,
32     mangle the string: ☃ (U+2603 SNOWMAN) -> %2603 which
33     actually means "&03".
34 =%S=
35     Leave the string as-is.
36 =%W=
37     Encode the string as UTF-8, then encode each byte of the UTF-8
38     individually as a http %xx escape: ö -> %C3%B6, ☃ (U+2603 SNOWMAN) ->
39     %E2%98%83.
40
41 http %xx encoding is defined in terms of input bytes, not input characters,
42 so you can't encode arbitrary Unicode into URLs without knowing which
43 encoding the destination server is going to use. UTF-8 is what's
44 recommended by the [[!wikipedia Internationalized resource identifier]]
45 specification, so I suspect %W is right more often than it's wrong...
46
47 I wonder whether %s should mean what %W does now, with a new format
48 character - maybe %L for Latin-1? - for the version that only works
49 for strings that can be encoded losslessly in Latin-1? --[[smcv]]