Hi All,
Recently I'm involved with a task to read a tab delimited text file in unicode and then convert them into a series of sql insert statements and then insert to mysql db.
I've successfully done the similar thing in the past with the text in ASCII using php's fgetcsv, but this time it does not work for this unicode file. In the file it has some funny characters like '®'.
Anyone had some hints on this?
Thank you very much.
Best Regards,
jim
reading unicode tab delimited text file in php
Moderator: General Moderators
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
explode() on tabs (\t) ?
edit| or do you mean the characters are giving you problems? you can run html_entities() on it with the charset set
edit| or do you mean the characters are giving you problems? you can run html_entities() on it with the charset set
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
Hi,
I think my problem nails down to these two lines of code, it doesn't seem to work:
Do you have any hints on it?
Thanks.
Best Regards,
Jim
I think my problem nails down to these two lines of code, it doesn't seem to work:
Code: Select all
$content = str_replace("®","®","®123");
print $content;Thanks.
Best Regards,
Jim