GNU bug report logs - #42007
ps-print encodes post-ASCII Unicode incorrectly for common characters

Previous Next

Package: emacs;

Reported by: "James P. Ascher" <jpsa <at> protonmail.com>

Date: Mon, 22 Jun 2020 17:02:01 UTC

Severity: normal

Merged with 35355, 41812

Found in versions 27.0.50, 28.0.50

Full log


View this message in rfc822 format

From: "James P. Ascher" <jpsa <at> protonmail.com>
To: 42007 <at> debbugs.gnu.org, viniciusjl <at> ig.com.br
Subject: bug#42007: ps-print encodes post-ASCII Unicode incorrectly for common characters
Date: Mon, 22 Jun 2020 16:47:52 +0000
I'd like to use ps-print to print hard copies of emails from my
colleagues, but it fails for certain common Unicode characters beyond
the basic ASCII, rendering them as '?'.

MINIMAL EXAMPLE:

1. New buffer with "What’s up?—Dude."
2. Call C-u M-x ps-print-buffer and save as test.ps
3. The line in question PostScript code reads:

(What?s up??Dude.) S

which renders:

"What?s up??Dude."

It should render "What’s up?—Dude."


DISCUSSION:

This fails for emoji and most of the hello file as well, but that's not
really what I'm after.  In trying to debug this, I made a little
progress.  In ps-print.el, `ps-output-string-prim` seems to be designed
to handle these, however:

(ps-output-string-prim "What’s up?—Dude.")

gives

(What\3FFFE2\3FFF80\3FFF99s up?\3FFFE2\3FFF80\3FFF94Dude.)

Putting that string in the PostScript file doesn't work quite right
either: it drops the back slash. So I think there are two bugs here:

Bug 1: Post-ASCII Unicode encodes as '?' instead of "\number"
Bug 2: Post-ASCII Unicode should be encoded so at least Ghostscript can
handle it.

Ghostscript supports post-ASCII Unicode:
https://ghostscript.com/doc/9.52/Use.htm#UnicodeTT

But, I don't know if such behavior is standard PostScript.  I also don't
know if there's a more obvious solution.

Respectfully submitted,
-James

-- 
James P. Ascher
Doctoral Student, English Department
University of Virginia





This bug report was last modified 3 years and 190 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.