troubleshooting Question

Browsers open PHP generated tab delimited file with quicktime, instead of inline inside the browser

Avatar of cfpdev
cfpdev asked on
3 Comments1 Solution214 ViewsLast Modified:
We are creating various CSV files with PHP. We have one CSV file, that uses iconv encoding in order to display Japanese characters, this file is also tab delimited, and not comma delimited, but is still saved with a '.csv' extension. This doesn't bother excel at all. Problem is, when we try to open this CSV file via a url, inline in the browser, the browser tries to open it using Quicktime.

This happens regardless whether the file is comma or tab delimited, it seems that the problem is the the japanese character encoding. I include a snippet of what our encoding code looks like, nothing special actually.

I have tried saving it as a txt file, but then it looses its Japanese character encoding.

Does anyone know how we can solve this?

$string= chr(255).chr(254).iconv ( 'UTF-8', 'UTF-16LE', "some japanese characters");

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros