[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: special characters in filenames in error messages
From: |
Karl Berry |
Subject: |
Re: special characters in filenames in error messages |
Date: |
Tue, 9 Dec 2008 00:42:00 +0100 |
Therefore, when you deal with an URI, you should use a different
algorithm of presentation within a GNU error message than when you
deal with a filename.
This seems like it adds complexity both in the description and in
comprehension. At least I am having trouble with it -- it seems like %
now means two different things, and a program has to know in advance
whether the source is a url or a filename. I am rather doubtful rms
would be happy with it.
As an alternative, we could simply use a different character than % for
our filename hex escape. Two that come to mind are ! (already a shell
metachar, unusual in filenames, not special in url's) and " itself.
Since : is not a hex digit, there is no ambiguity, I believe -- you just
have to search for ": to find the end of the escaped source name. And %
always means %.
filename:line ! escape " escape
-------- ----------- --------
a"b\nc%d:10 "a!22b!0ac%d":10 "a"22b"0ac%d":10
(where \n is
a real newline)
Despite the superficial ambiguity, using " seems somehow cleaner to me,
since it reduces special characters to the absolute minimum of one.
(BTW, TeX uses " to introduce hex constants in some contexts. Not that
that matters, I admit.)
Wdyt?
Thanks,
karl
Re: special characters in filenames in error messages, Bruno Haible, 2008/12/03