cupsfilter does not set "CHARSET=utf-8" into environment of texttops #4273

Closed
michaelrsweet opened this Issue Feb 11, 2013 · 3 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Feb 11, 2013

Version: 1.4.3
CUPS.org User: gurucubano

For rendering UTF-8 coded text files to Postscript, texttops need an environment value of "CHARSET=utf-8" (to pickup the correct Fonts for the UTF-8 codepoints based on the file charsets/utf-8); cupsfilter does not provide this environment variable when starting texttops; a patch could look like this:

diff cups-1.4.6/scheduler/cupsfilter.c*

838c838

< envp[13], / Environment variables */

          *envp[12],              /* Environment variables */

847d846
< charset[1024], /* CHARSET */
881d879
< snprintf(charset, sizeof(charset), "CHARSET=utf-8");
928,929c926
< envp[11] = charset;

< envp[12] = NULL;

envp[11] = NULL;

see also:
https://www.cups.org/newsgroups.php?s25696+gcups.general+v25707+T0

Matthias

Collaborator

michaelrsweet commented Feb 19, 2013

CUPS.org User: mike

P3

Collaborator

michaelrsweet commented Feb 19, 2013

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Feb 19, 2013

"str4273.patch":

Index: scheduler/cupsfilter.c

--- scheduler/cupsfilter.c (revision 10865)
+++ scheduler/cupsfilter.c (working copy)
@@ -3,7 +3,7 @@
*

  • Filtering program for CUPS.
  • * Copyright 2007-2012 by Apple Inc.
  • * Copyright 2007-2013 by Apple Inc.
  • Copyright 1997-2006 by Easy Software Products, all rights reserved.
  • These coded instructions, statements, and computer programs are the
    @@ -917,7 +917,7 @@
    {
    int i; /* Looping var /
    const char *argv[8], /
    Command-line arguments */
  •   _envp[15],      /_ Environment variables */
    
  •   _envp[16],      /_ Environment variables _/
    
    *temp; /_ Temporary string /
    char *optstr, /
    Filter options /
    content_type[1024], /
    CONTENT_TYPE */
    @@ -1040,7 +1040,8 @@
    envp[11] = printer_name;
    envp[12] = rip_max_cache;
    envp[13] = userenv;
  • envp[14] = NULL;
  • envp[14] = "CHARSET=utf-8";
  • envp[15] = NULL;

for (i = 0; argv[i]; i ++)
fprintf(stderr, "DEBUG: argv[%d]="%s"\n", i, argv[i]);

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment