From:             nikhil dot gupta at in dot ibm dot com
Operating system: Linux, Win32-xp
PHP version:      6CVS-2007-08-01 (snap)
PHP Bug Type:     *Unicode Issues
Bug description:  fgetcvs gives different output with and without Unicode

Description:
------------
fgetcsv() outputs different results with and without Unicode on Windows
and Linux.

Reproduce code:
---------------
--TEST--
Test fgetcsv()
--FILE--
<?php

$filename = dirname(__FILE__) . '/fgetcsv.tmp';


// create the file and add the content with has csv fields
$file_handle = fopen($filename, "w+t" );

$delimiter = '-';
$enclosure = '-';
$csv_field = '-water---fruit---air-';


@fwrite($file_handle, $csv_field );

// rewind the file pointer to bof
rewind($file_handle);

// use the right delimiter and enclosure with max length
var_dump( fgetcsv($file_handle, 1024, $delimiter, $enclosure) );

// close the file
fclose($file_handle);
//delete file
unlink($filename);

echo "Done\n";
?>
--EXPECT--

Expected result:
----------------
array(2) {
  [0]=>
  string(11) "water-fruit"
  [1]=>
  string(3) "air"
}
Done

Actual result:
--------------
array(1) {
  [0]=>
  unicode(12) "[EMAIL PROTECTED]@[EMAIL PROTECTED]"
}
Done

-- 
Edit bug report at http://bugs.php.net/?id=42163&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42163&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42163&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42163&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42163&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42163&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42163&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42163&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42163&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42163&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42163&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42163&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42163&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42163&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42163&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42163&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42163&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42163&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42163&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42163&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42163&r=mysqlcfg

Reply via email to