From owner-freebsd-ports Tue Jan 11 7: 0: 5 2000 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 7D0C2154BC for ; Tue, 11 Jan 2000 07:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA83243; Tue, 11 Jan 2000 07:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from kot.ne.mediaone.net (kot.ne.mediaone.net [24.218.15.190]) by hub.freebsd.org (Postfix) with ESMTP id 969081541A; Tue, 11 Jan 2000 06:56:14 -0800 (PST) (envelope-from mi@kot.ne.mediaone.net) Received: from rtfm.newton (mi@rtfm.newton [10.10.0.1]) by kot.ne.mediaone.net (8.9.3/8.9.1) with ESMTP id JAA28135; Tue, 11 Jan 2000 09:56:09 -0500 (EST) Received: (from mi@localhost) by rtfm.newton (8.9.3/8.9.3) id JAA99952; Tue, 11 Jan 2000 09:56:09 -0500 (EST) (envelope-from mi@kot.ne.mediaone.net) Message-Id: <200001111456.JAA99952@rtfm.newton> Date: Tue, 11 Jan 2000 09:56:09 -0500 (EST) From: Mikhail Teterin Reply-To: mi@kot.ne.mediaone.net To: FreeBSD-gnats-submit@FreeBSD.org Cc: jpeg-info@uunet.uu.net, jseger@FreeBSD.org X-Send-Pr-Version: 3.2 Subject: ports/16063: rdjpegcom part of the JPEG port ignores locale settings Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 /* to declare setlocale() */ #include /* 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 /* to declare setlocal() */ #include /* 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