Help with proper character encoding.

Posted by mmattax on Stack Overflow See other posts from Stack Overflow or by mmattax
Published on 2010-04-15T14:35:57Z Indexed on 2010/04/15 14:53 UTC
Read the original article Hit count: 217

I have a HTML form that is sometimes submitted with accented characters: à, è, ì, ò, ù

I have a PHP script that exports these form submissions into CSV format, when I look at the CSV format in a text editor (vim or notepad for example) the characters look fine, but when opened with Open Office or Word, I get some funky results: ?????

I am also passing these submission to salesforce and am getting an error: "The entity "Atilde" was referenced, but not declared."

What can I do to ensure portability of my CSV file? What's the proper way to handle the encoding?

My HTML file is content-type is set as: Content-Type: text/html; charset=utf-8 Data is being stored in MySQL as latin1_swedish_ci collation.

© Stack Overflow or respective owner

Related posts about php

Related posts about character-encoding