Re: Characters in an uploaded text file being corrupted

Niel Archer <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
Hi

> Ok, and, FWIW, this test text file is a word document that have saved as a 
> text file, and when now resaved it using specifically unicode encoding, it 
> seemd to eliminate this issue,

Make sure the MySQL Db, table, field are correctly set for the encoding.
MySQL does not default to UTF-8 so you have to manually set it when
creating the Db/table. IIRC, newer versions can also have the encoding
set per field.

> but would have thought there might be a 
> relatively simple way to handle something like encoding conversion in PHP 
> itself..?

PHP cannot read minds, unfortunately. There are ways to handle encoding
conversions, but I don't think anyone would call them 'simple'. ;-)
See the Multibyte String extension for one way.

--
Niel Archer


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.