FROM: ascii => ascii? ;
IN: help.html
+ERROR: not-printable ch ;
+
+: check-printable ( ch -- ch )
+ dup printable? [ not-printable ] unless ;
+
: escape-char ( ch -- )
dup ascii? [
[
{ CHAR: # "__hash__" }
{ CHAR: % "__percent__" }
} at
- ] [ % ] [ , ] ?if
+ ] [ % ] [ check-printable , ] ?if
] [ number>string "__" "__" surround % ] if ;
: escape-filename ( string -- filename )