[cups.bugs] [MOD] STR #2447: texttops has incomplete UTF-8/UCS support

Roger Leigh rleigh at debian.org
Mon Jul 16 14:51:07 PDT 2007


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

The CUPS texttops filter appears to do an incomplete job of converting
UTF-8 input to PostScript output.  This includes both CJK and some
symbols.

The full Debian bug report may be found here:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=387752

A few ways to demonstrate the bug are detailed in the above bug report,
but are reproduced verbatim below:

We also need to know what happens *when CUPS itself* trys to run the
filter, since CUPS sets up a very specific environment and command-line
options for it.  If you try the LogLevel=debug I suggested, you would see
*exactly* what environment and options CUPS is using.

That said, here's how I suggest you test it on the command-line:

1) Create some UTF-8 text.  If you don't already have any (and this
   is useful for comparison in any case), try:

   % man 7 groff_char -Tps > /tmp/testutf8-direct.ps

   % man 7 groff_char -Tutf8 > /tmp/testutf8

2) Run the texttops filter on the text:

   % CHARSET=utf-8 CONTENT_TYPE=text/plain CUPS_DATADIR=/usr/share/cups
   CUPS_SERVERROOT=/etc/cups DEVICE_URI=file:///tmp/test
   FINAL_CONTENT_TYPE=application/vnd.cups-postscript LANG=en
   PRINTER=test PPD=/etc/cups/ppd/fake.ppd RIP_CACHE=8192
   SOFTWARE=CUPS/1.2 TZ=GMT USER=rleigh /usr/lib/cups/filter/texttops 1
   rleigh myfile 1 "" </tmp/testutf8 >/tmp/testutf8.ps
   2>/tmp/testutf8.log

   This can be simplified to

   % CHARSET=utf-8 /usr/lib/cups/filter/texttops 1 rleigh myfile 1 ""
   </tmp/testutf8 >/tmp/testutf8.ps 2>/tmp/testutf8.log

3) Check /tmp/testutf8.log for errors or messages

4) Look at the generated /tmp/testutf8.ps

5) Compare with /tmp/testutf8-direct.ps.  I notice some missing
   symbols, indicating that the filter isn't doing a perfect job.

6) To test your date problem:

   % LANG=zh_TW.utf8 LC_CTYPE=zh_TW.utf8 date
   日  7月 15 23:00:59 BST 2007

[note Chinese glyphs before 7 and 15, in case UTF-8 is not liked by
str.php]

   % CHARSET=utf-8 CONTENT_TYPE=text/plain CUPS_DATADIR=/usr/share/cups
   CUPS_SERVERROOT=/etc/cups DEVICE_URI=file:///tmp/test
   FINAL_CONTENT_TYPE=application/vnd.cups-postscript LANG=zh_TW.utf8
   LC_CTYPE=zh_TW.utf8  PRINTER=test PPD=/etc/cups/ppd/fake.ppd
   RIP_CACHE=8192 SOFTWARE=CUPS/1.2 TZ=GMT USER=rleigh date|
   /usr/lib/cups/filter/texttops 1 rleigh myfile 1 ""
   >/tmp/testutf8date.ps 2>/tmp/testutf8date.log

7) Check the generated /tmp/testutf8date.ps

   I see the Hangul(?) glyphs missing in the file.

That's the extent to which I have been able to test the problem so far. 
It appears that certain UCS glyphs are not preserved in the PostScript
output.


Regards,
Roger

Link: http://www.cups.org/str.php?L2447
Version: 1.2.12





More information about the cups mailing list