I have put this little script in the code to see what kind of charset is the scrip using <?php $link = mysql_connect('localhost', 'root', 'coloso'); $charset = mysql_client_encoding($link); echo "The current character set is: $charset\n";?> PHP: The current character set is: latin1 I have the database in mysql set to utf-8 and I don't know why it is displaying through the script above that it is set to latin1? I want to know if the script above it's displaying the character set of the database or the one of the script because the DB is set to UTF-8_general_ci and all the tables and TEXT, and VARCHAR fields to utf-8_general_ci I don't know why it is displaying Latin1 through the script above. Well I am glad to know that there is a conflict now between latin1 and utf-8 and that's what cuasing now to displaying some character which I have input in the database such as ú,á,é,à etc.. I am glad just need some of your help now to set up the script to utf-8 thank!!
The tables as well as entire database can have their own collation, (ie: the field collation doesn't define the entire database's collation) If you have phpMySQL you'll see on the 'operations' tab at the bottom the collation for that specific database or table that can be changed in that manner. Far as the script, you want to make sure your code editor is set to write in UTF-8 as well as having UTF-8 defined in your html doctype, as a conflict can occur at any of those points.
How can I set the code editor to write in UTF-8 and the html doctype to be in UTF-8 as well? Thank you..
The first part depends on your editor, Coda for example (a Mac based IDE) actually asks Western/Latin1 or UTF8 when creating a project, many other IDE are similar. Far as the html side, at the top of the HTML, this would be an example of an xHTML 1.0 document with UTF8 encoding. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Code (markup): (the first line was echo'd out by php since its a php page and <? without escaping would cause it to break, but it helps put IE into quirks mode) The meta line can be omitted if you're gona send the headers directly to the browser with php (and generally recommended to do so since that way it knows the encoding before it even receives the file) using something like this. header('Content-Type: text/html; charset=utf-8'); PHP: edit: keep in mind, header() can only be used at the top of a document, as you cannot send headers to a browser if some data such as html has already been sent to the browser.
Now it is displaying and rating perfectly the only thing is that when i rate it the item name "pesuñas" is being stored as "pesuñas" in phpmyadming. it seem like the database is not recieving in utf8 or the script is not sending in uft8.. Thanks now at least it is displaying and rating... the only issue is as above now I have to say that the rating system uses an independent connection of the one used by the other web pages. The rating sytem is an object oriented script which uses the code below $ratingData = Rating::OutputRating($platename); if (Error::HasErrors()) { echo Error::ShowErrorMessages(); Error::ClearErrors(); } else { echo $ratingData; } PHP: to display and store the data. as I said it uses an independent database connection and might be set to recieved and send utf-8 data. This system uses a database, error, and rating class to work... I think because of it's individualization of the website pages, database connection, mysql_set_charset and other functions maybe it is outputing and storing the data in the database in another charset.
Read the other thread: http://forums.digitalpoint.com/showthread.php?t=1458779 PHPMyAdmin shows you what the collation is, check if it's utf8.