Reputation: 7906
Please see the code below
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
</head>
<body>
<div>
¿Hola cómo está?
</div>
</body>
</html>
In this code, i want to print the characters properly as given in the file. 1 solution is to save the file in UTF-8 format. Is there any other way of doing it?
Upvotes: 1
Views: 353
Reputation: 3877
Use HTML symbols such as £ for example.
http://www.ascii.cl/htmlcodes.htm
Upvotes: 1
Reputation: 13058
Saving the file as UTF-8 is insufficient. You should also signal the HTTP client (browser) that it's a UTF-8 document. This can be done in two ways:
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
into <head>
element.To your original question, the encoding of the PHP file can be different - you'll just have to re-encode the string from the local encoding to UTF-8 before you send it.
Upvotes: 3