Failure accentuation XML to mysql

Asked

Viewed 144 times

0

I’m facing a strange mistake with accentuation. I set my database, table and structure to UTF-8. Utilise:

header('Content-Type: text/html; charset=utf-8');
mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET character_set_client=utf8');
mysql_query('SET character_set_results=utf8');
mysql_set_charset('utf8');

And even so, when I upload the XML file, saved in the database with format error. I have already used "accept-charset" in FORM, and also saved with errors in accentuation.

I thought it was the XML file with the errors, but I opened it by "Notepad++" (which is also already UTF-8 without BOM), and the failure persists.

Someone’s been through this trouble?

  • Can you use a debugg on the server and check if the xml you uploaded contains accentuation errors? because it isolates the problem, being it in the insertion in the bank (sorry if it is being redundant).

  • I checked here, and the XML is free of accentuation errors. This failure is likely to occur at the time the upload is made. Now, how this happens, I don’t know. When saved, it already has the format without accentuation. ex: SÃ Paulo

  • From what I saw in your code vc is defining in php that every query should be done in the standard utf-8, you made sure in your database and your tables are in this same standard of Collection?

  • Oops, all right @Rafaelandrade?

  • Oops, all right @Rafaelandrade? So I figured out where the fault is, and I still don’t know how to fix it, but I’m using a "palliative" method. Apparently, the file saved by EXCEL, format to UTF-8, saved with emphasis in both XML and CSV (yes I created another script to send CSV). However, every time I upload, everything is not formatted in the database. So, instead of opening with Notepad++ to see the file, I opened it with windows Notepad and saved it as "name.xml (or csv)", and it worked. I don’t know why it worked hahaha, but I’m wearing it so far.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.