We help IT Professionals succeed at work.
Get Started

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

cfpdev
cfpdev asked
on
212 Views
Last Modified: 2013-12-12
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

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE