Edit report at https://bugs.php.net/bug.php?id=49874&edit=1
 ID:                 49874
 Updated by:         yohg...@php.net
 Reported by:        jketterl at chipxonio dot de
 Summary:            ftell() and fseek() inconsistency when using stream
                     filters
 Status:             Open
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   linux (ubuntu)
-PHP Version:        5.2.11
+PHP Version:        5.5.4
 Block user comment: N
 Private report:     N

 New Comment:

It seems 5.5 has this problem still

string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(5) "e 01
"
[yohgaki@dev php-5.4]$ php -v
PHP 5.5.4 (cli) (built: Sep 19 2013 13:06:40)


Previous Comments:
------------------------------------------------------------------------
[2009-10-15 06:54:31] jketterl at chipxonio dot de

thanks for having a look

i tried with and without. the challenge is to get it working without, because 
that's the worst case my app has to deal with, but the BOM doesn't seem to 
solve this.

$ hexdump test-with-bom.csv
0000000 feff 004c 0069 006e 0065 0020 0030 0031
0000010 000a 004c 0069 006e 0065 0020 0030 0032
0000020 000a 004c 0069 006e 0065 0020 0030 0033
0000030 000a 004c 0069 006e 0065 0020 0030 0034
0000040 000a
0000042

$ php test.php
string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(5) "e 01
"

i also tried opening the file including the BOM without a stream filter, but 
that just resulted in php reading in two extra chars (the BOM converted in some 
way i guess) on the beginning of the first line.

i thought i'd attach the sample files to this bug, but it seems like i can't. 
i've uploaded them here instead: https://bugs.php.net/bug.php?id=49874&edit=1

Reply via email to

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant