bug#42007: ps-print encodes post-ASCII Unicode incorrectly for common characters

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#42007: ps-print encodes post-ASCII Unicode incorrectly for common characters

Emacs - Bugs mailing list
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




Reply | Threaded
Open this post in threaded view
|

bug#42007: ps-print encodes post-ASCII Unicode incorrectly for common characters

Emacs - Bugs mailing list
> I don't think ps-print supports non-ASCII characters beyond Latin-1,
> definitely not unless you customize ps-mule and ps-bdf with
> appropriate font.
>
> Sorry.

No worries!  Knowing not to bang my head on that wall is
certainly progress.

Thanks for the quick response.