php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36843 input conversion failed due to input error
Submitted: 2006-03-24 10:49 UTC Modified: 2006-04-10 13:18 UTC
From: tonera at gmail dot com Assigned: rrichards (profile)
Status: Not a bug Package: XML related
PHP Version: 5.1.2 OS: windowsxp
Private report: No CVE-ID: None
 [2006-03-24 10:49 UTC] tonera at gmail dot com
Description:
------------
the code is not run at php5. it send a error:
Warning: input conversion failed due to input error in d:\site\wowdkp\test.php on line 28
and return false.
but it can return (int)1 at php4.
or ,change the words of "gb2312" to "utf-8" .it return 'int(1)'
<?php
/**
+-----------------------------------------------------------------------+
* @autor tonera <tonera at gmail.com>;
* @since 2006-3-3
* @version $Id: test.php,v 1.0 tonera$
* @description	
+-----------------------------------------------------------------------+
*/

$parser = xml_parser_create();

$bb= <<<__EOF__
<?xml version="1.0" encoding="gb2312"?>
<RaidInfo>
<Join>


<key35><player>?b֮????</player><time>02/21/06 23:56:37</time></key35>
</Join>


</RaidInfo>
__EOF__;

xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING,1);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
$rs		= xml_parse_into_struct($parser, $bb, $values, $tags);

var_dump($rs);
?>

Reproduce code:
---------------
$bb= <<<__EOF__
<?xml version="1.0" encoding="gb2312"?>
<RaidInfo>
<Join>


<key35><player>?b֮????</player><time>02/21/06 23:56:37</time></key35>
</Join>


</RaidInfo>
__EOF__;

Expected result:
----------------
int(1)

Actual result:
--------------
Warning: input conversion failed due to input error in d:\site\wowdkp\php\module\admin\mod_Admin.php on line 734
int(0)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-10 13:18 UTC] rrichards@php.net
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.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Not a PHP issue. XML would not parse correctly with various parsers unless encoding was changed to GB18030.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC