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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "James P. Ascher" <jpsa@HIDDEN>; merged with #35355, #41812; dated Mon, 22 Jun 2020 17:02:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 35355 41812 42007. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Forcibly Merged 35355 42007. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 42007 <at> debbugs.gnu.org:


Received: (at 42007) by debbugs.gnu.org; 22 Jun 2020 19:11:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 22 15:11:18 2020
Received: from localhost ([127.0.0.1]:34552 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jnRqg-0007pH-0b
	for submit <at> debbugs.gnu.org; Mon, 22 Jun 2020 15:11:18 -0400
Received: from mail-40136.protonmail.ch ([185.70.40.136]:12904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jpsa@HIDDEN>) id 1jnRqd-0007p3-P9
 for 42007 <at> debbugs.gnu.org; Mon, 22 Jun 2020 15:11:17 -0400
Date: Mon, 22 Jun 2020 19:11:07 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1592853069;
 bh=1xDd9/Zw/zAsgK3Vkjnrxcu2kTWHDpCV2GU8dofoBE4=;
 h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From;
 b=hb0bmk98XKClhNA5Xku05RMlOrv9i2pTgEsZcP8qy59LzYpmhLS3PR4m2vnSs7yMK
 BSnAAJif5UMWwyc9kB4Ut5CaQxdpOEO3+Z3U/Caqh+L8phqmD47dS6kYheu7ac0xm8
 P7+4MczhBqGFkc/i0QxaOBc2ZHIWgCz8+TdQ4myQ=
To: Eli Zaretskii <eliz@HIDDEN>
From: "James P. Ascher" <jpsa@HIDDEN>
Subject: Re: bug#42007: ps-print encodes post-ASCII Unicode incorrectly for
 common characters
Message-ID: <m0366mkjbb.fsf@HIDDEN>
In-Reply-To: <83o8pbt1qu.fsf@HIDDEN>
References: <m0h7v3jbdb.fsf@HIDDEN> <83o8pbt1qu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no
 autolearn=disabled version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 42007
Cc: 42007 <at> debbugs.gnu.org, viniciusjl@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: "James P. Ascher" <jpsa@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> 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.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42007; Package emacs. Full text available.

Message received at 42007 <at> debbugs.gnu.org:


Received: (at 42007) by debbugs.gnu.org; 22 Jun 2020 18:05:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 22 14:05:45 2020
Received: from localhost ([127.0.0.1]:34485 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jnQpF-0006Dg-BA
	for submit <at> debbugs.gnu.org; Mon, 22 Jun 2020 14:05:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51724)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1jnQpB-0006DR-K4
 for 42007 <at> debbugs.gnu.org; Mon, 22 Jun 2020 14:05:44 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46259)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1jnQp6-00043M-Co; Mon, 22 Jun 2020 14:05:36 -0400
Received: from [176.228.60.248] (port=2901 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1jnQp5-0004Ss-Bq; Mon, 22 Jun 2020 14:05:35 -0400
Date: Mon, 22 Jun 2020 21:05:29 +0300
Message-Id: <83o8pbt1qu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "James P. Ascher" <jpsa@HIDDEN>
In-Reply-To: <m0h7v3jbdb.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#42007: ps-print encodes post-ASCII Unicode incorrectly for
 common characters
References: <m0h7v3jbdb.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 42007
Cc: 42007 <at> debbugs.gnu.org, viniciusjl@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 22 Jun 2020 16:47:52 +0000
> From: "James P. Ascher" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 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."

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42007; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 Jun 2020 17:01:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 22 13:01:53 2020
Received: from localhost ([127.0.0.1]:34418 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jnPpM-0004gy-JS
	for submit <at> debbugs.gnu.org; Mon, 22 Jun 2020 13:01:53 -0400
Received: from lists.gnu.org ([209.51.188.17]:34756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jpsa@HIDDEN>) id 1jnPc8-0004Ma-5R
 for submit <at> debbugs.gnu.org; Mon, 22 Jun 2020 12:48:09 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48638)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jpsa@HIDDEN>)
 id 1jnPc7-0004pn-Iu
 for bug-gnu-emacs@HIDDEN; Mon, 22 Jun 2020 12:48:07 -0400
Received: from mail1.protonmail.ch ([185.70.40.18]:34763)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jpsa@HIDDEN>)
 id 1jnPc4-0000CB-UP
 for bug-gnu-emacs@HIDDEN; Mon, 22 Jun 2020 12:48:07 -0400
Date: Mon, 22 Jun 2020 16:47:52 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1592844478;
 bh=sA6oTlj95yJZtuzuDpbxw4B0SO2zEzZjCJvUrPJ1kXU=;
 h=Date:To:From:Reply-To:Subject:From;
 b=JegN53VAd74OPxR16RxmDZB0ov+c26yUqNXRlunwNYckEd2+fXpfE58+q49veNChU
 vzEPeQocOyoe/9c2oc+b59mNUYzpF7IVHO5LQAhbz3aL4TBrO+4x6OucwC1om18L0l
 4PNtVyxySrqTBwCsNW9+3ouDO6YDqiq+RxCoYPyw=
To: bug-gnu-emacs@HIDDEN, Vinicius Jose Latorre <viniciusjl@HIDDEN>
From: "James P. Ascher" <jpsa@HIDDEN>
Subject: ps-print encodes post-ASCII Unicode incorrectly for common characters
Message-ID: <m0h7v3jbdb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no
 autolearn=disabled version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail.protonmail.ch
Received-SPF: pass client-ip=185.70.40.18; envelope-from=jpsa@HIDDEN;
 helo=mail1.protonmail.ch
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/22 12:48:00
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic] [fuzzy]
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 22 Jun 2020 13:01:47 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: "James P. Ascher" <jpsa@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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=E2=80=99s up?=E2=80=94Dude."
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=E2=80=99s up?=E2=80=94Dude."


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=E2=80=99s up?=E2=80=94Dude.")

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

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





Acknowledgement sent to "James P. Ascher" <jpsa@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#42007; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 31 Jul 2021 16:45:02 UTC

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