Fwd: php-windows Digest 19 May 2008 13:39:11 -0000 Issue 3474

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi anton
you can try utf8_encode function of php .it worked for me in a similarsituation.
Cheers.................

---------- Forwarded message ----------From:  <php-windows-digest-help@xxxxxxxxxxxxx>Date: Tue, May 20, 2008 at 1:39 AMSubject: php-windows Digest 19 May 2008 13:39:11 -0000 Issue 3474To: php-windows@xxxxxxxxxxxxx


php-windows Digest 19 May 2008 13:39:11 -0000 Issue 3474
Topics (messages 28901 through 28901):
Working with Excel csv retrieved data (using fgetcsv) and unknown characters       28901 by: Anton Heuschen
Administrivia:
To subscribe to the digest, e-mail:       php-windows-digest-subscribe@xxxxxxxxxxxxx
To unsubscribe from the digest, e-mail:       php-windows-digest-unsubscribe@xxxxxxxxxxxxx
To post to the list, e-mail:       php-windows@xxxxxxxxxxxxx

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

---------- Forwarded message ----------From: "Anton Heuschen" <antonfh@xxxxxxxxx>To: php-windows@xxxxxxxxxxxxxxxxx: Mon, 19 May 2008 15:39:06 +0200Subject: Working with Excel csv retrieved data (using fgetcsv) andunknown charactersThis is run on an XP box with WAMP install:
I have a script that downloads a Excel CSV file and then uses fgetscv toretrieve lines, the strange thing is that in Firefox I get symbols (blacktriangle with question mark in it) and in IE its basically spaces. So if Iecho these values (or print_r array result, my text string has spaces), Ivetried opening it in Notepad etc to see what characters or codes these spacesare, but it shows nothing. Ive opened it in PSPad and its shows only asunknown characters (square blocks).
Im suspecting it might be tabs ?
Is there a way to remove any "unknown" characters from a line retrieved withfgetsv ?

the getscv line used:
$handle = fopen($local_file, "r");   while(($data = @fgetcsv($handle,1000,",")) !== FALSE)   {
if I print out (print_r) this $data I get something like :
_�2�0�0�8�0�4�0�3� �1�4�2�0�5�1�0�0�Array(   [0] => ÿþE�v�e�n�t�:� �A�B�C�-�0�0�0�1�8�
   [1] => �2�   [2] => �3�


There should be no question mark symbols but should rather look like:
_20080403 14205100Array(   [0] => ÿþEvent: ACC-10018   [1] => 2
   [2] => 3



-- RegardsSandeep Khokher

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux