Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2000 09:56:09 -0500 (EST)
From:      Mikhail Teterin <mi@kot.ne.mediaone.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        jpeg-info@uunet.uu.net, jseger@FreeBSD.org
Subject:   ports/16063: rdjpegcom part of the JPEG port ignores locale settings
Message-ID:  <200001111456.JAA99952@rtfm.newton>

next in thread | raw e-mail | index | archive | help

>Number:         16063
>Category:       ports
>Synopsis:       rdjpegcom part of the JPEG port ignores locale settings
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 11 07:00:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mikhail Teterin
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
Virtual Estates, Inc.
>Environment:

>Description:

	JPEG file comments in charsets other then US-ASCII are printed
	with each character represented by its octal value. This is
	because rdjpgcom.c uses isprint(3) to determine if a character
	is printable, but does NOT call setlocale(3) prior to that,
	thus ignoring the user's setting for LANG.

>How-To-Repeat:

	Get a file with such comment -- for example,
	http://people.ne.mediaone.net/kot/vse-tri-gruppy-colorado99.jpg

	and try
	  env LANG=ru_SU.KOI8-R rdjpegcom vse-tri-gruppy-colorado99.jpg

>Fix:
	This (or similar) patch needs to be applied (can be placed into
	patches/patch-locale).	

	It also patches djpeg, which may call isprint(3) similarly when
	the operations are traced.

--- rdjpgcom.c.orig	Sat Oct 11 18:41:04 1997
+++ rdjpgcom.c	Tue Jan 11 09:35:11 2000
@@ -17,1 +17,2 @@
+#include <locale.h>		/* to declare setlocale() */
 #include <ctype.h>		/* to declare isupper(), tolower() */
@@ -234,3 +234,4 @@
+  setlocale(LC_ALL, "");
   while (length > 0) {
     ch = read_1_byte();
     /* Emit the character in a readable form.
--- djpeg.c.orig	Sat Oct 11 18:29:07 1997
+++ djpeg.c	Tue Jan 11 09:32:49 2000
@@ -29,1 +29,2 @@
+#include <locale.h>		/* to declare setlocal() */
 #include <ctype.h>		/* to declare isprint() */
@@ -388,4 +389,7 @@
+  if (traceit) {
+    setlocale(LC_ALL, "");
+  }
   while (--length >= 0) {
     ch = jpeg_getc(cinfo);
     if (traceit) {
       /* Emit the character in a readable form.

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001111456.JAA99952>