htmlutf-8windows-1255

HTML - charset windows 1255 works but utf-8


I wrote html page that displays mixed hebrew/english content.It works fine with charset "windows - 1255"

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html dir="rtl" lang="he">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">

,But I figured that people will have trouble if their machines doesn't support hebrew. I changed the charset to utf-8 and got

HTML:

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

View:

"��� ��� ������, ��� ����� �����, �� ������ ���� ��� ���� �� ������"
Read zohar ��� ����
....

Isn't utf-8 suppose to support more chars then windows 1255?


Solution

  • I guess when you changed the tag, you didn't tell your editor to convert the file to UTF-8. So, the file is still in Windows-1255 format, but the browser tries to read it as if it was UTF-8, so you get bad/unreadable characters.

    I have no idea which editor you're using, so i can't tell you how to put it in UTF-8 mode. Try to find a setting in your options regarding the character set to use. Or, open the file in Windows notepad, and when saving it, make sure you select "Codepage: UTF-8" from the drop down box next to the save button.