spanish accents
Moderator: General Moderators
-
alexislalas
- Forum Commoner
- Posts: 44
- Joined: Sun Feb 19, 2006 10:09 pm
spanish accents
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
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
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
That shouldn't be necessary.feyd wrote:Make them entities.
Code: Select all
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">Code: Select all
header('Content-Type: text/html; charset=iso-8859-1');- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
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.the correct charset for Castellano is iso-8859-1.
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.
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:
In MySQL I was using latin1_general_ci Collation for my "Name" Field.
Thanx Bokehman
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