Bug 184596

Summary: converters/php5-iconv: iconv transliteration support broken on 10
Product: Ports & Packages Reporter: Michael Gmelin <freebsd>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Michael Gmelin 2013-12-08 16:20:00 UTC
php5-iconv has been changed to use FreeBSD's native iconv implementation where available (read FreeBSD 10). Unfortunately FreeBSD doesn't support GNU iconv's TRANSLIT and IGNORE extensions, which are clearly documented to be supported unconditionally on any platform by the PHP project:

http://www.php.net/manual/en/function.iconv.php
"out_charset 

 The output charset. 

If you append the string //TRANSLIT to out_charset transliteration is activated. This means that when a character can't be represented in the target charset, it can be approximated through one or several similarly looking characters. If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded. Otherwise, str is cut from the first illegal character and an E_NOTICE is generated."

As a result, PHP code that runs correctly on other operating systems or FreeBSD < 10 will break in subtle ways on 10.

Fix: 

Implement TRANSLIT/IGNORE extensions in base or make the port use converters/libiconv.
How-To-Repeat: Run the following code snippet:

cat t.php <<EOF
<?php

print iconv("UTF-8", "ISO-8859-1//TRANSLIT", "T\xc5\xbdst\n");

?>
EOF

FreeBSD 9.2:
$ php t.php
TZst

FreeBSD 10 BETA3:
$ php t.php
T?st
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-08 16:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-29 20:41:36 UTC
Author: tijl
Date: Wed Jan 29 20:41:27 2014
New Revision: 341778
URL: http://svnweb.freebsd.org/changeset/ports/341778
QAT: https://qat.redports.org/buildarchive/r341778/

Log:
  Allow the use of //TRANSLIT and //IGNORE with PHP iconv.
  
  PR:		ports/184596
  Tested by:	grembo
  Approved by:	ale (maintainer)

Modified:
  head/converters/php5-iconv/Makefile
  head/converters/php53-iconv/Makefile
  head/converters/php55-iconv/Makefile
  head/lang/php5/Makefile.ext
  head/lang/php53/Makefile.ext
  head/lang/php55/Makefile.ext

Modified: head/converters/php5-iconv/Makefile
==============================================================================
--- head/converters/php5-iconv/Makefile	Wed Jan 29 20:39:35 2014	(r341777)
+++ head/converters/php5-iconv/Makefile	Wed Jan 29 20:41:27 2014	(r341778)
@@ -1,6 +1,7 @@
 # Created by: Alex Dupre <ale@FreeBSD.org>
 # $FreeBSD$
 
+PORTREVISION=	1
 CATEGORIES=	converters
 
 MASTERDIR=	${.CURDIR}/../../lang/php5

Modified: head/converters/php53-iconv/Makefile
==============================================================================
--- head/converters/php53-iconv/Makefile	Wed Jan 29 20:39:35 2014	(r341777)
+++ head/converters/php53-iconv/Makefile	Wed Jan 29 20:41:27 2014	(r341778)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
+PORTREVISION=	1
 CATEGORIES=	converters
 
 MASTERDIR=	${.CURDIR}/../../lang/php53

Modified: head/converters/php55-iconv/Makefile
==============================================================================
--- head/converters/php55-iconv/Makefile	Wed Jan 29 20:39:35 2014	(r341777)
+++ head/converters/php55-iconv/Makefile	Wed Jan 29 20:41:27 2014	(r341778)
@@ -1,6 +1,7 @@
 # Created by: Alex Dupre <ale@FreeBSD.org>
 # $FreeBSD$
 
+PORTREVISION=	1
 CATEGORIES=	converters
 
 MASTERDIR=	${.CURDIR}/../../lang/php55

Modified: head/lang/php5/Makefile.ext
==============================================================================
--- head/lang/php5/Makefile.ext	Wed Jan 29 20:39:35 2014	(r341777)
+++ head/lang/php5/Makefile.ext	Wed Jan 29 20:41:27 2014	(r341778)
@@ -128,7 +128,7 @@ CONFIGURE_ARGS+=--enable-hash \
 .if ${PHP_MODNAME} == "iconv"
 CONFIGURE_ARGS+=--with-iconv
 
-USES+=	iconv
+USES+=	iconv:translit
 .endif
 
 .if ${PHP_MODNAME} == "imap"

Modified: head/lang/php53/Makefile.ext
==============================================================================
--- head/lang/php53/Makefile.ext	Wed Jan 29 20:39:35 2014	(r341777)
+++ head/lang/php53/Makefile.ext	Wed Jan 29 20:41:27 2014	(r341778)
@@ -127,7 +127,7 @@ CONFIGURE_ARGS+=--enable-hash \
 .if ${PHP_MODNAME} == "iconv"
 CONFIGURE_ARGS+=--with-iconv
 
-USES+=	iconv
+USES+=	iconv:translit
 .endif
 
 .if ${PHP_MODNAME} == "imap"

Modified: head/lang/php55/Makefile.ext
==============================================================================
--- head/lang/php55/Makefile.ext	Wed Jan 29 20:39:35 2014	(r341777)
+++ head/lang/php55/Makefile.ext	Wed Jan 29 20:41:27 2014	(r341778)
@@ -128,7 +128,7 @@ CONFIGURE_ARGS+=--enable-hash \
 .if ${PHP_MODNAME} == "iconv"
 CONFIGURE_ARGS+=--with-iconv
 
-USES+=	iconv
+USES+=	iconv:translit
 .endif
 
 .if ${PHP_MODNAME} == "imap"
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2014-01-29 21:03:04 UTC
State Changed
From-To: open->closed

Fixed in r341778.