tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Encoding non-alphanumeric characters in manpage filenames



Should this become popular enough, an option to ls could decode the encoded forms
upon request.

Good idea, provided that the convention is also used for things other than manpages.

Tools that download files from web, email, etc. probably use some kind of encoding for weird chars. Maybe we should check what they do. For example, wget(1). URL encoding or quoted-printable would be a natural choice for those jobs.

$ echo "str" | vis -h

should do the job here, I think :). And vis(3)/unvis(3) also exist.

Good find! That's pretty close to a good encoding.

https://datatracker.ietf.org/doc/html/rfc1808 says:

   unreserved  = alpha | digit | safe | extra
   safe        = "$" | "-" | "_" | "." | "+"
   extra       = "!" | "*" | "'" | "(" | ")" | ","

Of those, "*" is invalid in FAT/NTFS filenames.

"." is used to split the filename extension from the stem part, so ideally "." would be escaped in the stem.

"$" "!" "*" "'" "(" ")" are shell metacharacters. (As we know, they can still be used in filenames, but backslash escaping is required; would be nice to avoid two layers of escaping in common situations.)




Home | Main Index | Thread Index | Old Index