From saper@saper.info  Thu Jan 22 11:10:13 2009
Return-Path: <saper@saper.info>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 48BD7106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Jan 2009 11:10:13 +0000 (UTC)
	(envelope-from saper@saper.info)
Received: from k.saper.info (unknown [IPv6:2001:41d0:1:c823::])
	by mx1.freebsd.org (Postfix) with ESMTP id D28258FC17
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Jan 2009 11:10:12 +0000 (UTC)
	(envelope-from saper@saper.info)
Received: from k.saper.info (localhost [127.0.0.1])
	by k.saper.info (8.14.2/8.14.2) with ESMTP id n0MB6m1x050275
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Jan 2009 11:06:48 GMT
	(envelope-from saper@saper.info)
Received: (from uucp@localhost)
	by k.saper.info (8.14.2/8.14.2/Submit) with UUCP id n0MB6mE1050274
	for FreeBSD-gnats-submit@freebsd.org; Thu, 22 Jan 2009 11:06:48 GMT
	(envelope-from saper@saper.info)
Received: from radziecki.saper.info (localhost [127.0.0.1])
	by radziecki.saper.info (8.14.3/8.14.3) with ESMTP id n0MB6ZMZ017756
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Jan 2009 12:06:35 +0100 (CET)
	(envelope-from saper@saper.info)
Received: (from saper@localhost)
	by radziecki.saper.info (8.14.3/8.14.3/Submit) id n0MB6Ztg017745;
	Thu, 22 Jan 2009 12:06:35 +0100 (CET)
	(envelope-from saper)
Message-Id: <200901221106.n0MB6Ztg017745@radziecki.saper.info>
Date: Thu, 22 Jan 2009 12:06:35 +0100 (CET)
From: Marcin Cieslak <saper@SYSTEM.PL>
Reply-To: Marcin Cieslak <saper@SYSTEM.PL>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: graphics/librsvg2: fix for locale bug in rsvg-convert
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         130868
>Category:       ports
>Synopsis:       graphics/librsvg2: fix for locale bug in rsvg-convert
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 22 11:20:01 UTC 2009
>Closed-Date:    Sun Feb 01 16:39:41 UTC 2009
>Last-Modified:  Sun Feb  1 16:40:11 UTC 2009
>Originator:     Marcin Cieslak
>Release:        FreeBSD 7.1-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD radziecki.saper.info 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0 r182840M: Sun Sep 7 22:50:12 CEST 2008 saper@radziecki.saper.info:/usr/obj/usr/src/sys/VAIO amd64

Please assign to gnome@

>Description:

rsvg-convert as released has an annoying bug:

Bug 557036 – rsvg-convert uses the wrong locale for command line processing

http://bugzilla.gnome.org/show_bug.cgi?id=557036

rsvg-convert refuses to work on UTF-8 filenames in the filesystem, regardless of the current locale.

Attached please find a simple patch to fix this.
Patch by Tim Starling of Wikimedia.

>How-To-Repeat:

Try to run rsvg-convert using UTF-8 filesnames.
The result:

Invalid byte sequence in conversion input

>Fix:

setlocale(3) should be called early at startup

--- rsvg-convert.c	2007-07-01 23:43:44.000000000 +1000
+++ rsvg-convert.c	2008-10-20 16:52:27.000000000 +1100
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <locale.h>
 
 #include "rsvg.h"
 #include "rsvg-cairo.h"
@@ -52,7 +53,7 @@
 display_error (GError * err)
 {
     if (err) {
-        g_print ("%s", err->message);
+        g_print ("%s\n", err->message);
         g_error_free (err);
     }
 }
@@ -165,6 +166,9 @@
         {NULL}
     };
 
+	/* Set the locale so that UTF-8 filenames work */
+	setlocale(LC_ALL, "");
+
 	g_thread_init(NULL);
 
     g_option_context = g_option_context_new (_("- SVG Converter"));
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Jan 22 11:20:12 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130868 
State-Changed-From-To: open->closed 
State-Changed-By: mezz 
State-Changed-When: Sun Feb 1 16:39:27 UTC 2009 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130868 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/130868: commit references a PR
Date: Sun,  1 Feb 2009 16:39:27 +0000 (UTC)

 mezz        2009-02-01 16:39:16 UTC
 
   FreeBSD ports repository
 
   Modified files:
     graphics/librsvg2    Makefile 
   Added files:
     graphics/librsvg2/files patch-cmdline-bugfixes 
   Log:
   Fix the rsvg-convert when using UTF-8 filename, bump the PORTREVISION.
   
   PR:             ports/130868
   Submitted by:   Marcin Cieslak <saper@SYSTEM.PL>
   Obtained from:  http://tinyurl.com/cuab6v
   
   Revision  Changes    Path
   1.70      +1 -1      ports/graphics/librsvg2/Makefile
   1.1       +29 -0     ports/graphics/librsvg2/files/patch-cmdline-bugfixes (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
