Re: Characters in an uploaded text file being corrupted

From: Date: Sun, 27 May 2012 14:57:05 +0000
Subject: Re: Characters in an uploaded text file being corrupted
References: 1 2 3  Groups: php.windows 
Request: Send a blank email to php-windows+get-30893@lists.php.net to get a copy of this message
Ok, specifically told that storage field to make use of UTF8_unicode_ci, and tried re-uploading text file that specifically saved from word using UTF8 encoding, and, the text content is still full of garbage characters..? Suppose might try something like copying/pasting from text file in notepad, into something like a textarea field, but, don't think that would always be the perfect process in this site. Will try a couple of other options with regard to DB encoding, and see if come right, but, let's see... Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ----- Original Message ----- From: "Niel Archer" <spam-free@blueyonder.co.uk> To: <php-windows@lists.php.net> Sent: Sunday, May 27, 2012 4:22 PM Subject: Re: [PHP-WIN] Characters in an uploaded text file being corrupted
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


« previous php.windows (#30893) next »