用非英语语言创建网页
Creating web page in non-english language
我想在我的网站中使用非英语语言(例如:孟加拉语)。我正在使用以下无效的标签。
我的项目编码是widows-1252。我正在使用字体为 Arial Unicode MS 的 net-beans 7.0。
是否必须将我的项目编码更改为 UTF-8 或其他方式?
请帮助
<%@ page language="java" contentType="text/html; charset=UTF-8 pageEncoding="UTF-8" %>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<table >
<tr >
<td >বাঙালি </td>
</tr>
</table>
Is it mandatory to change my project encoding to UTF-8 or other ways are there?
您可以使用任何支持所需字符的编码(widows-1252 不会为您完成这项工作,因为它是针对拉丁字母表的)。自世纪之交以来,对 Unicode(几乎支持所有语言)的支持一直非常出色。在过去的十五年里,您应该一直将它用于所有新项目。
除了更改为支持您需要的字符的编码外,您还可以使用HTML character references。通常这将是:
Decimal numeric character reference
The ampersand must be followed by a "#" (U+0023) character, followed by one or more ASCII digits,
representing a base-ten integer that corresponds to a Unicode code
point that is allowed according to the definition below. The digits
must then be followed by a ";" (U+003B) character.
由于字符引用是用 ASCII 字符表示的,因此您可以用任何编码来表示它们(因为它们建立在 ASCII 之上)。
我想在我的网站中使用非英语语言(例如:孟加拉语)。我正在使用以下无效的标签。
我的项目编码是widows-1252。我正在使用字体为 Arial Unicode MS 的 net-beans 7.0。 是否必须将我的项目编码更改为 UTF-8 或其他方式? 请帮助
<%@ page language="java" contentType="text/html; charset=UTF-8 pageEncoding="UTF-8" %>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<table >
<tr >
<td >বাঙালি </td>
</tr>
</table>
Is it mandatory to change my project encoding to UTF-8 or other ways are there?
您可以使用任何支持所需字符的编码(widows-1252 不会为您完成这项工作,因为它是针对拉丁字母表的)。自世纪之交以来,对 Unicode(几乎支持所有语言)的支持一直非常出色。在过去的十五年里,您应该一直将它用于所有新项目。
除了更改为支持您需要的字符的编码外,您还可以使用HTML character references。通常这将是:
Decimal numeric character reference The ampersand must be followed by a "#" (U+0023) character, followed by one or more ASCII digits, representing a base-ten integer that corresponds to a Unicode code point that is allowed according to the definition below. The digits must then be followed by a ";" (U+003B) character.
由于字符引用是用 ASCII 字符表示的,因此您可以用任何编码来表示它们(因为它们建立在 ASCII 之上)。