Re: Character escaping
On 12/5/03 10:40 PM Bob MacIsaac wrote: [...] This is likely something simple but I've spent too much time on it with no results - hope somebody can help - thanks. Hi Bob - try looking into the $dbh-quote() method. --Jo -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Character escaping
I have searched the archives for a solution to my problem and also the FAQ and the mysql documentation but can't seem to resolve it. I am exporting a tab delimited file from FileMaker Pro 5.5 using Mac OS 10.3. I am uploading the file to my hosted server running RedHat Linux 7.2. I am then importing the file to a mysql (4.0.15-standard) table using this code (Perl DBI). $sth = $dbh-prepare (qq{LOAD DATA LOCAL INFILE '$file_to_load' REPLACE INTO TABLE Listing_Data FIELDS TERMINATED BY '\t' ESCAPED BY '\' LINES TERMINATED BY '\r' IGNORE 0 LINES}); The problem is that apsotrophy (') and quote () characters do not escape properly - I am getting (Õ) and (Ó) characters instead. I have tried a test of escaping the text e.g. Johnson\'s Rd. - but it doesn't seem to make it through the import. Have also tried running the text through a Perl substitution on the server $line =~ s/(['])/\\\$1/g; this escapes the characters in the text file but they still appear incorrect in the mysql table. The default character set for the database is latin1. This is likely something simple but I've spent too much time on it with no results - hope somebody can help - thanks. Bob MacIsaac -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]