• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error inserting special characters (spanish) into database

#9
[eluser]JoostV[/eluser]
Hi Yayot,

Of course, be my guest.

Summing it all up in a nutshell: if you want to succesfully create a utf-8 site do ALL of the following:
1. create your code in an editor using utf-8 encoding
2. set up your db to use utf-8 charset and utf-8 collation (if you database is not in utf-8 run 'alter database mydatabase charset=utf8;')
3. before executing any queries, run query 'SET NAMES 'utf8''
4. before output to screen, set response header using header('Content-type: text/xml; charset=utf-8');
5. include meta tag <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

For future reference,if you ever need to create XML, use
Code:
header('Content-type: text/xml; charset=utf-8');

Browsers will now interpret your output as XML.


Messages In This Thread
Error inserting special characters (spanish) into database - by El Forum - 07-04-2009, 12:04 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.