Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2005-08-14, 09:40 PM
Junior Member
 
Join Date: Aug 2005
Posts: 6
boonerite
Default

Quote:
Hi, I used the following codes to split the "Text (Tab delimited) (*.txt)" format I saved as using my Excel

$email = fgetcsv($fp,999, "\t");

cell1 cell2
王 test@email.com

it works
$email[0] contains 王
and
$email[0] contains test@email.com

but it will result in "??" displayed in the text document instead of 王

so I tried to use Save As Unicode Text (*.txt)
it displays the unicode character as it is
but, the
$email = fgetcsv($fp,999, "\t"); can't seem to split it up anymore, even though it shows 王 test@email.com in the text file

anyone can explain why or how to rectify?
thanks!
hmm... I just confirmed that PHP doesnt seem to be able to read any text document which is encoded as UNICODE (choose SAVE AS from text editor)
The thing is, I need to read out the unicode characters in the unicoded text document

@ $fp = fopen("email.txt",'r');
$email = fgetcsv($fp,999, "\t");

This doesnt seem to work if the email.txt is in unicoded
how to make it readable ?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2005-08-14, 10:20 PM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

i just use explode() to break the lines up.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2005-08-15, 12:32 AM
Junior Member
 
Join Date: Aug 2005
Posts: 6
boonerite
Default

Hi, i tried, but it seem to be the same problem
the problem seem to lie at the part where it is being SAVED AS Unicode Text (*.txt)
and PHP doesnt seem to be able to read it (when I open it up to save its encoding as UNICODE or UTF-8)
why cant php read the document?
it just get stuck right at the part it tries to read the document
help~
Reply With Quote
  #4 (permalink)  
Old 2005-08-15, 10:38 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Why are you using UNICODE? Do you need to?

If not, just save it as a tab delimited text file.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #5 (permalink)  
Old 2005-08-18, 11:28 PM
Junior Member
 
Join Date: Aug 2005
Posts: 6
boonerite
Default

yep, due to the reason of needing to deal with chinese, korea, thai characters
help~
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:25 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.