Page 1 of 1
spanish accents
Posted: Fri Oct 13, 2006 12:22 pm
by alexislalas
hello to all.
im reading from a mysql database. inside the DB the characters are fine, when i check it on localhost they are fine. but once i upload it to the internet, the accents turn into question marks.
ive tried <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> and it doesnt work.
anyone here can help me? thanks
Posted: Fri Oct 13, 2006 12:28 pm
by RobertGonzalez
I think this can be changed with the browser (Character Encoding).
Posted: Fri Oct 13, 2006 1:03 pm
by feyd
Make them entities.
Posted: Fri Oct 13, 2006 4:22 pm
by bokehman
feyd wrote:Make them entities.
That shouldn't be necessary.
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
That is the correct charset. My guess is the webserver is sending a conflicting header which takes precedence over this meta element. Try adding a header to your code to stop this behaviour.
Code: Select all
header('Content-Type: text/html; charset=iso-8859-1');
Posted: Sat Oct 14, 2006 12:32 pm
by Cameri
UTF-8 could get the work done too pal... One time I got into an irc channel, and the users there were using accents, and only those who had clients that supported UTF-8 could see them (I wasn't using mIRC back then).
Posted: Sat Oct 14, 2006 12:58 pm
by bokehman
That may be so but the correct charset for Castellano is iso-8859-1.
Posted: Sun Oct 15, 2006 12:45 pm
by Ambush Commander
the correct charset for Castellano is iso-8859-1.
Incorrect. Character encodings are simply mappings of bytes to characters, so as long as a charset provides all the characters necessary to express a language, it is usable. Thus, there are no "correct" charsets, but there are "incorrect"/"inefficient"/"rarely used" ones, i.e. you can't (without great difficulty) use Latin-1 to write Arabic.
While I strongly recommend you switch to UTF-8, keep in mind that you will have to convert characters from iso-8859-1 to UTF-8 using
iconv if you choose to go that path. For now, take bokehman's advice and try sending the proper header.
Posted: Fri Dec 29, 2006 11:37 am
by emmbec
I was having the same problem and I just wanted to let you know that my problem was solved using this code at the begining of my page:
Code: Select all
<?php
header('Content-Type: text/html; charset=iso-8859-1');
?>
In MySQL I was using
latin1_general_ci Collation for my "Name" Field.
Thanx Bokehman
Posted: Sat Dec 30, 2006 4:27 am
by Jaxolotl