ID:               31030
 Updated by:       [EMAIL PROTECTED]
 Reported By:      rq at akl dot lt
-Status:           Open
+Status:           Bogus
 Bug Type:         ICONV related
 Operating System: Linux
 PHP Version:      4.3.9
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

See the following post in [EMAIL PROTECTED]:
http://news.php.net/php.i18n/766


Previous Comments:
------------------------------------------------------------------------

[2004-12-09 02:01:16] rq at akl dot lt

Description:
------------
It's a duplicate of Bug #29852, which I cannot comment because it's
marked as "Bogus", which it's not

I'm using iconv() for some charset conversions, and, before converting
anything to users' supplied charset, i use iconv() to check whether it
would convert flawlessly. And I noticed, that iconv() never returns any
error if at least the first character in the array given for conversion,
is convertable.

However, i think it's a bug somewhere in PHP, because the iconv(1)
console command outputs an error in both similar cases:

[EMAIL PROTECTED]:~ $ echo "rūta" > r
[EMAIL PROTECTED]:~ $ iconv -futf-8 -tascii r
riconv: illegal input sequence at position 1
^^ note the "r" here.

[EMAIL PROTECTED]:~ $ echo "ūta" > r
[EMAIL PROTECTED]:~ $ iconv -futf-8 -tascii r
iconv: illegal input sequence at position 0
[EMAIL PROTECTED]:~ $ echo "ruta" > r
[EMAIL PROTECTED]:~ $ iconv -futf-8 -tascii r
ruta


Reproduce code:
---------------
I wrote a small testcase script to demonstrate this issue. It's located
at:
http://jazz.lma.lt/~rq/iconv.php
and source is at:
http://jazz.lma.lt/~rq/iconv.phps.

For example, check out these two links:
http://jazz.lma.lt/~rq/iconv.php?text=r%C3%BBta&charset=ascii&submit=
http://jazz.lma.lt/~rq/iconv.php?text=%C3%BBta&charset=ascii&submit=

The only difference in them is an "r" letter in the beginning of the
"text" variable. And in case it exists in "text", no errors are
reported.

Expected result:
----------------
In both cases, iconv() should have reported an error.

Actual result:
--------------
iconv() did not return an error in the first case, when there was an
ASCII letter before any unconvertable strings.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31030&edit=1

Reply via email to