hi anton

you can try utf8_encode function of php .it worked for me in a similar
situation.

Cheers.................


---------- Forwarded message ----------
From:  <[EMAIL PROTECTED]>
Date: Tue, May 20, 2008 at 1:39 AM
Subject: php-windows Digest 19 May 2008 13:39:11 -0000 Issue 3474
To: php-windows@lists.php.net



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:
       [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
       [EMAIL PROTECTED]

To post to the list, e-mail:
       php-windows@lists.php.net


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


---------- Forwarded message ----------
From: "Anton Heuschen" <[EMAIL PROTECTED]>
To: php-windows@lists.php.net
Date: Mon, 19 May 2008 15:39:06 +0200
Subject: Working with Excel csv retrieved data (using fgetcsv) and
unknown characters
This is run on an XP box with WAMP install:

I have a script that downloads a Excel CSV file and then uses fgetscv to
retrieve lines, the strange thing is that in Firefox I get symbols (black
triangle with question mark in it) and in IE its basically spaces. So if I
echo these values (or print_r array result, my text string has spaces), Ive
tried opening it in Notepad etc to see what characters or codes these spaces
are, but it shows nothing. Ive opened it in PSPad and its shows only as
unknown characters (square blocks).

Im suspecting it might be tabs ?

Is there a way to remove any "unknown" characters from a line retrieved with
fgetsv ?


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




-- 
Regards
Sandeep Khokher

Reply via email to