TOgakangaroo Posted January 18, 2007 Share Posted January 18, 2007 Hello, I am working on a large project which involves among other things storing names with international characters in MySQL tables. This data is typically delivered via spreadsheets so I have written a utility to do upload a file and do just that. I am running into the problem currently that certain characters (i.e. the spanish e with an accent) will not import correctly causing the rest of the name to be cut off.So for example, running$term = 'México';mysql($database_info, "INSERT INTO tblSomeTable VALUES $term"); will store only 'M'.If I hardwire the term into the querymysql($database_info, "INSERT INTO tblSomeTable VALUES 'México'");It doesn't cut off but does insert gibberishOne intersting thing that I've found is that everything works out fine when the variable is passed through the HTTP Post Methodmysql($database_info, "INSERT INTO tblSomeTable VALUES $_POST['name']");where $_POST["name"]='México' from a form imputthis inserts correctly.My intuition is that I need to set PHP to use the same encoding that HTTP POST uses but I don't know if that's true nor exactly how to do that. Has anybody run into this problem before/can help me out?Thanks a lot for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.