https://bugzilla.novell.com/show_bug.cgi?id=271353 Summary: Client locale number format messes up postscript conversion on CUPS server Product: openSUSE 10.2 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Printing AssignedTo: jsmeix@novell.com ReportedBy: aleksander.adamowski.novell@altkom.pl QAContact: jsmeix@novell.com In our company, we have a CUPS printing server running OpenSuSe 10.2 (cups-1.2.7-3). My CUPS client is an Ubuntu Dapper system with all the latest updates installed (cupsys-client at version 1.2.2-0ubuntu0.6.06). My user's locale settings are for Polish language and regional stuff: LANG=pl_PL.UTF-8 LANGUAGE=pl_PL:pl:en_GB:en LC_CTYPE="pl_PL.UTF-8" LC_NUMERIC="pl_PL.UTF-8" LC_TIME="pl_PL.UTF-8" LC_COLLATE="pl_PL.UTF-8" LC_MONETARY="pl_PL.UTF-8" LC_MESSAGES="pl_PL.UTF-8" LC_PAPER="pl_PL.UTF-8" LC_NAME="pl_PL.UTF-8" LC_ADDRESS="pl_PL.UTF-8" LC_TELEPHONE="pl_PL.UTF-8" LC_MEASUREMENT="pl_PL.UTF-8" LC_IDENTIFICATION="pl_PL.UTF-8" LC_ALL= When submitting any print job to CUPS, the locale setting gets propagated with the job to the CUPS serwer (OpenSuSe). Here are relevant excerpts from the server's logs: [Job 29440] envp[10]="SOFTWARE=CUPS/1.2.7" [Job 29440] envp[11]="TMPDIR=/var/spool/cups/tmp" [Job 29440] envp[12]="USER=root" [Job 29440] envp[13]="CUPS_SERVER=/var/run/cups/cups.sock" [Job 29440] envp[14]="CUPS_ENCRYPTION=IfRequested" [Job 29440] envp[15]="IPP_PORT=631" [Job 29440] envp[16]="CHARSET=utf-8" [Job 29440] envp[17]="LANG=pl_PL" Here, the job gets filtered and during the conversion to PostScript, the locale settings affect number format used (this is a bug). Polish locale uses commas instead of dots as the decimal separator, so the resulting document isn't proper PostScript. In this testcase, I've printed an ordinary text file containing only the text "test". Here's the problematic PostScript from CUPS debug logs on the server. Note the commas instead of dots in page size specifications: [Job 29440] %%Creator: texttops/CUPS v1.2.7 [Job 29440] %%CreationDate: pi<C2><B1> 04 maj 2007 15:50:57 CEST [Job 29440] %%Title: (test.txt) [Job 29440] %%For: (olo) [Job 29440] %%Pages: (atend) [Job 29440] %%DocumentNeededResources: font Courier-Bold [Job 29440] %%+ font Courier [Job 29440] %%+ font Symbol [Job 29440] %%DocumentSuppliedResources: procset texttops 1.1 0 [Job 29440] %%+ font Courier-Bold [Job 29440] %%+ font Courier [Job 29440] %%+ font Symbol [Job 29440] %%EndComments [Job 29440] Before copy_prolog - %%BeginProlog [Job 29440] Before copy_setup - %%Page: 1 1 [Job 29440] Before page loop - %%Page: 1 1 [Job 29440] Copying page 1... [Job 29440] pagew = 547,0, pagel = 770,0 [Job 29440] bboxw = 595, bboxl = 842 [Job 29440] PageLeft = 24,0, PageRight = 571,0 [Job 29440] PageTop = 818,0, PageBottom = 48,0 [Job 29440] PageWidth = 595,0, PageLength = 842,0 [Job 29440] Wrote 1 pages... If I set the LANG variable to "POSIX" on the client (Ubuntu laptop), the job gets printed correctly. Here are relevant fragments of CUPS server logs for comparison: [Job 29441] envp[10]="SOFTWARE=CUPS/1.2.7" [Job 29441] envp[11]="TMPDIR=/var/spool/cups/tmp" [Job 29441] envp[12]="USER=root" [Job 29441] envp[13]="CUPS_SERVER=/var/run/cups/cups.sock" [Job 29441] envp[14]="CUPS_ENCRYPTION=IfRequested" [Job 29441] envp[15]="IPP_PORT=631" [Job 29441] envp[16]="CHARSET=utf-8" [Job 29441] envp[17]="LANG=en" .. [Job 29441] %!PS-Adobe-3.0 [Job 29441] %%BoundingBox: 0 0 595 842 [Job 29441] %cupsRotation: 0 [Job 29441] %%Creator: texttops/CUPS v1.2.7 [Job 29441] %%CreationDate: Fri May 4 15:53:52 2007 [Job 29441] %%Title: (test.txt) [Job 29441] %%For: (olo) [Job 29441] %%Pages: (atend) [Job 29441] %%DocumentNeededResources: font Courier-Bold [Job 29441] %%+ font Courier [Job 29441] %%+ font Symbol [Job 29441] %%DocumentSuppliedResources: procset texttops 1.1 0 [Job 29441] %%+ font Courier-Bold [Job 29441] %%+ font Courier [Job 29441] %%+ font Symbol [Job 29441] %%EndComments [Job 29441] Before copy_prolog - %%BeginProlog [Job 29441] Before copy_setup - %%Page: 1 1 [Job 29441] Before page loop - %%Page: 1 1 [Job 29441] Copying page 1... [Job 29441] pagew = 547.0, pagel = 770.0 [Job 29441] bboxw = 595, bboxl = 842 [Job 29441] PageLeft = 24.0, PageRight = 571.0 [Job 29441] PageTop = 818.0, PageBottom = 48.0 [Job 29441] PageWidth = 595.0, PageLength = 842.0 [Job 29441] Wrote 1 pages... I think the proper solution would be to reset the LANG variable to POSIX, but use the client-supplied CHARSET variable on the CUPS server when spawning filters. This way, there should be no character set mismatch errors, and the filters should generate proper postscript. I've found out that an effective workaround on the CUPS server is to replace all the *tops filters with wrapper scripts that reset LANG, e.g.: cd /usr/lib64/cups/filter/ mv texttops texttops.orig mv pstops pstops.orig ..etc, etc.... Then prepare wrapper scripts that reset LANG and call original filter binaries like this one (for texttops): #!/bin/sh export LANG=POSIX /usr/lib64/cups/filter/texttops.orig "$@" -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.