Bug 692270 - Improve ghostscripts stdin/stdout handling w.r.t unicode
Summary: Improve ghostscripts stdin/stdout handling w.r.t unicode
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: PC Windows XP
: P4 enhancement
Assignee: Default assignee
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2011-06-09 17:01 UTC by Robin Watts
Modified: 2011-06-09 20:11 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
0001-Add-Sags-unicode-patch-for-gswin32c-stdin-out.patch (9.97 KB, text/plain)
2011-06-09 18:10 UTC, Robin Watts
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Watts 2011-06-09 17:01:03 UTC
gswin32c.exe now assumes that all input from stdin has been UTF8 encoded, and similarly writes all output UTF8 encoded. Characters that come in with top bits set will therefore confuse things.

Ideally we should process stdin so that we cope with unicode input, encoding as we go, and stdout so we convert utf8 back to unicode. In the case of file redirection, we want the files to come in exactly as they are though, so the unicode->utf8 munging should only effect things when the input is a terminal.
Comment 1 Robin Watts 2011-06-09 18:10:57 UTC
Created attachment 7584 [details]
0001-Add-Sags-unicode-patch-for-gswin32c-stdin-out.patch

Patch provided by Sags.
Comment 2 Robin Watts 2011-06-09 20:11:08 UTC
Committed as:

commit ce51b64c335d6c995c003497988d0327c64985cb
Author: Robin Watts <Robin.Watts@artifex.com>
Date:   Thu Jun 9 16:07:15 2011 +0100

    Add Sags unicode patch for gswin32c stdin/out.

    Patch from Sags to read/write stdin/stdout as unicode and convert
    to/from utf8 when passing to/reading from the core.

    Once again, build with WINDOWS_NO_UNICODE to preserve old behaviour.

    See bug 692770.

    CLUSTER_UNTESTED.