escaped spaces in \pdfescapestring
Hi Heiko, what is the reason to escape spaces and newlines in \pdfescapestring? \def\mystr{A B^^JC} \tt %\pdfescapename{\mystr} % this is obsious \pdfescapestring{\mystr} % ? \end BR, -- Pawe/l Jackowski P.Jackowski@gust.org.pl
On Thu, Jun 23, 2005 at 11:21:55AM +0200, Pawel Jackowski wrote:
Hi Heiko,
what is the reason to escape spaces and newlines in \pdfescapestring?
\def\mystr{A B^^JC} \tt %\pdfescapename{\mystr} % this is obsious \pdfescapestring{\mystr} % ? \end
Following the specification there is no reason, it says,
"any 8-bit value may appear in a string".
However: '\', '(', and ')' _must_ be escaped.
Thus we can save space by only escaping the "must" characters.
But I am not feeling too well with this extreme.
\pdfescapename and \pdfescapestring are useful for PostScript, too.
Here the strings are passed through \special, dvips and the
PostScript-Interpreter. Are you sure, that nothing happens with
control characters, eg. newlines <LF> recoded as <CR><LF>, ...?
Perhaps the 8-bit characters can be output directly, here
I am not sure, if the 7-bit-safety here is just paranoia.
In case of names:
* Some characters such as delimiters and '#' _must_ be
escaped.
* Others, such as control and 8-bit characters are
recommended for escaping.
Thus \pdfescapename follows the recommendation.
Yours sincerely
Heiko
Pawel:
what is the reason to escape spaces and newlines in \pdfescapestring?
Heiko:
Following the specification there is no reason[...] Are you sure, that nothing happens with control characters, eg. newlines <LF> recoded as <CR><LF>, ...?
Yes, you're absolutely right.
In case of names: * Some characters such as delimiters and '#' _must_ be escaped. * Others, such as control and 8-bit characters are recommended for escaping. Thus \pdfescapename follows the recommendation.
I've just encountered a problem. Shouldn't \pdfescapename also escape `%' character? \escapechar=-1 \setbox0\hbox{Aqq} \immediate\pdfxform attr {/\pdfescapename{M\string\%Y} /Val}0 \pdfrefxform\pdflastxform \end This produce corrupted output BR, -- Pawe/l Jackowski P.Jackowski@gust.org.pl
Hello, On Thu, Jun 23, 2005 at 02:39:00PM +0200, Pawel Jackowski wrote:
I've just encountered a problem. Shouldn't \pdfescapename also escape `%' character?
Yes, you are right, many thanks, it belongs to the delimiter characters
that need escaping. I fix it in the next patch, I want to upload soon.
Yours sincerely
Heiko
Heiko,
I've just encountered a problem. Shouldn't \pdfescapename also escape `%' character?
Yes, you are right, many thanks, it belongs to the delimiter characters that need escaping. I fix it in the next patch, I want to upload soon.
OK! I've made a lot of tests on all \pdfescape*'s but I couldn't find anything more complain :) I like it very much. Already described in manual and samplepdf file. Regards, -- Pawe/l Jackowski P.Jackowski@gust.org.pl
participants (2)
-
Heiko Oberdiek
-
Pawel Jackowski