Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Jacob Kruger
Ok, issue sorted - for now anyway - helps to get some rest, and then consider alternatives to a problem... function morphString($sIn) { $sOut = ""; for ($I = 0; $I < strlen($sIn); $I++) { $sChr = $sIn[$I]; if (ord($sChr) >= 10 && ord($sChr) <= 126) { $sOut .= chr(ord($sChr)); } }//end of looping

Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Jacob Kruger
Thanks - will check that out, but only issue is that this will need end-users to try sort something like this out, and they won't necessarily be the most technical types as such, and, I also wouldn't have too much control over what they'd originally used to generate the content. Am thinking th

Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Carl Roett
Do not use Microsoft Word to save files that need to be read-in by other software. Ever. It *always* finds a way to screw it up. Even if you cut and paste it into the other program, I've heard cases where Word has put unprintable control characters into the pasted output, that showed-up as spaces i

Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Jacob Kruger
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 notepa

Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Niel Archer
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

Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Jacob Kruger
Ok, and, again, it hasn't completely eliminated issue, but has seemed to sort out certain characters, but, not all of them..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' - Original Message - From: "Jacob Kruger" To: Sent: S

Re: [PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Jacob Kruger
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, but would have thought there might be a relatively simple way to handle something like encoding conversion in PHP

[PHP-WIN] Characters in an uploaded text file being corrupted

2012-05-27 Thread Jacob Kruger
Using the following bit of code, I am then saving the contents of an uploaded text file into a mysql database, but, the issue seems to be that immediately after retrieving the contents of the temporary path of the uploaded file, for example, things like ' characters are rendering as ? characters