Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2013 01:53:28 +0000 (UTC)
From:      Peter Wemm <peter@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254080 - head/lib/libc/iconv
Message-ID:  <201308080153.r781rSDa010991@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: peter
Date: Thu Aug  8 01:53:27 2013
New Revision: 254080
URL: http://svnweb.freebsd.org/changeset/base/254080

Log:
  Our libc iconv (unlike gnu iconv and the citrus code in NetBSD) has a
  bypass mode when src == dst.  Unfortunately, there are tools in ports
  that pass byte streams through iconv to determine if the encodings
  are valid.  eg: gettext-0.18.3+.
  
  Disable the optimization and behave like the other implementations.

Modified:
  head/lib/libc/iconv/citrus_iconv.c

Modified: head/lib/libc/iconv/citrus_iconv.c
==============================================================================
--- head/lib/libc/iconv/citrus_iconv.c	Thu Aug  8 00:06:25 2013	(r254079)
+++ head/lib/libc/iconv/citrus_iconv.c	Thu Aug  8 01:53:27 2013	(r254080)
@@ -116,7 +116,20 @@ open_shared(struct _citrus_iconv_shared 
 	size_t len_convname;
 	int ret;
 
+#ifdef INCOMPATIBLE_WITH_GNU_ICONV
+	/*
+	 * Sadly, the gnu tools expect iconv to actually parse the
+	 * byte stream and don't allow for a pass-through when
+	 * the (src,dest) encodings are the same.
+	 * See gettext-0.18.3+ NEWS:
+	 *   msgfmt now checks PO file headers more strictly with less
+	 *   false-positives.
+	 * NetBSD don't do this either.
+	 */
 	module = (strcmp(src, dst) != 0) ? "iconv_std" : "iconv_none";
+#else
+	module = "iconv_std";
+#endif
 
 	/* initialize iconv handle */
 	len_convname = strlen(convname);



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