[cups.development] Character conversion issue in templates

Ozan Çağlayan ozan at pardus.org.tr
Tue Feb 22 06:39:19 PST 2011


Hi,

When the preferred language is Turkish in the browser (tested with Chrome and Firefox), the templates
the CUPS web interface are not correctly handled as in Turkish toupper() and tolower() behaves differently
if the LC_CTYPE is set to tr_TR.UTF-8.

(In Turkish, the uppercase of lower 'i' is not 'I' but 'İ' (with a dot above), and vice versa.)

The patch below fixes the problem by locale-independently converting the cases.

The result of the problem is that the {title} and {device_uri} templates are not replaced by
their values.

If you think that this is the correct fix or this should be fixed in CUPS, I can create a ticket
with the full patch attached.


--- cups-1.4.6/cups/language.c.orig·2011-02-22 16:09:23.390000054 +0200
+++ cups-1.4.6/cups/language.c· 2011-02-22 16:11:34.248000054 +0200
@@ -44,6 +44,7 @@
 #include "debug.h"
 #include <stdlib.h>
 #include <errno.h>
+#include <locale.h>
 #ifdef HAVE_LANGINFO_H
 #  include <langinfo.h>
 #endif /* HAVE_LANGINFO_H */
@@ -599,8 +600,9 @@
   else
   {
    /*
-    * Copy the parts of the locale string over safely...
+    * Copy the parts of the locale string over safely and ignore locale dependant character conversion...
     */
+    setlocale(LC_CTYPE, "C");



---
Ozan Çağlayan
TUBITAK/UEKAE - Pardus Linux
http://www.pardus.org.tr/eng





More information about the cups mailing list