PDA

View Full Version : Output Spanish Characeters with Javascript


elandgren
09-06-2004, 11:03 PM
I'm trying to show spanish text obtained from a SQL database using Javascript, but some characters are not shown as they should be...

Example: Mañana appears as Mañana

It happens the same with á, é, í, ó and ú.

Is there someone that knows how to solve it?? I hope I'm not the only spanish that is affected by this problem....

fci
09-07-2004, 12:39 AM
if you are using PHP.. maybe htmlentities() may be able to aid you(not sure though):
http://us2.php.net/htmlentities

glenngv
09-07-2004, 06:40 AM
It may be a charset problem. Try this:

<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>

Or set the content type in the server-side.