Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 16:17:22 GMT
From:      Michael Gmelin <freebsd@grem.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/184596: converters/php5-iconv: iconv transliteration support broken on 10
Message-ID:  <201312081617.rB8GHMsA033914@oldred.freebsd.org>
Resent-Message-ID: <201312081620.rB8GK0tM072864@freefall.freebsd.org>

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

>Number:         184596
>Category:       ports
>Synopsis:       converters/php5-iconv: iconv transliteration support broken on 10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 08 16:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Michael Gmelin
>Release:        10.0-BETA3
>Organization:
Grem Equity GmbH
>Environment:
FreeBSD srv10 10.0-BETA3 FreeBSD 10.0-BETA3 #0: Mon Dec 2 20:44:29 UTC 2013 root@:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
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.
>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
>Fix:
Implement TRANSLIT/IGNORE extensions in base or make the port use converters/libiconv.

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



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