可以在unicode中指定HTML源文件吗? [英] Can an HTML source file be specified in unicode ?

查看:90
本文介绍了可以在unicode中指定HTML源文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有以下原则问题:

写的包含古希腊语的HTML页面,有两个

的可能性:一种是将unicode字符直接写入HTML源代码中的
(编码为两个字节),并将此源保存为ASCII文本而不是
,但是作为UNICODE文本文件(每个

字符使用16位,对于西方ASCII字符也是如此,通常

编码为Ox00XX,XX为ASCII码);或写一个纯ASCII

HTML源代码,其中希腊字符全部用

& #XXXX符号编码。我甚至有一个小的计算机程序可以转换后者的

前者。

有趣的是,像Netscape7.2这样的浏览器似乎有

没有问题接受unicode编码的源文件并显示

一切都好。

现在,我和其他人的讨论如下:

因为直接输入unicode HTML源代码更容易,这是一般来说,这是一个可以接受的事情,或者是这个(这是我的观点) a

完全不道德的事情,因为在Netscape中有一些

邋iness,但HTML源代码从来没有

故意不要首先是ASCII文本?我想

他们看到我应该通过我的程序运行他们的源文件

将unicode文件转换为带有真正unicode的ASCII文件

字符(在casu古希腊符号中)替换为& #XXX ascii

字符序列;他们的观点是,这是废话,

并且鉴于它适用于Netscape,这意味着它是一个正确的事情。
>

那么,这个(学术性)讨论的结果应该是什么?

HTML源代码必须是ASCII代码,或者现在允许它是

UNICODE编码文本?

感谢任何学到的启发,


Patrick。

Hello,

I have the following problem of principle:
in writing HTML pages containing ancient greek, there are two
possibilities: one is to write the unicode characters directly
(encoded as two bytes) into the HTML source, and save this source not
as an ASCII text, but as a UNICODE text file (using 16 bits per
character, also for the Western ASCII characters, which are usually
encoded as Ox00XX with XX the ASCII code) ; or to write a pure ASCII
HTML source, where the greek characters are all encoded with the
&#XXXX symbols. I have even a small computerprogram that converts the
former in the latter.
The funny thing is, that a browser such as Netscape7.2 seems to have
no problems accepting a unicode encoded sourcefile and displays
everything all right.
Now, the discussion I''m having with other people is the following:
as it is easier to type directly the unicode HTML source, is this, in
general, an acceptable thing to do, or is this (that''s my viewpoint) a
totally unethical thing to do that simply works because of some
sloppiness in Netscape, but that HTML source code was never
intentioned not to be ASCII text in the first place ? I would like
them to see that I should run their source files through my program
that converts a unicode file into an ASCII file with the true unicode
characters (in casu ancient greek symbols) replaced by &#XXX ascii
character sequences ; their point of view is that this is bullshit,
and given the fact that it works for Netscape, that means that it is a
correct thing to do.

So, what should be the outcome of this (academic) discussion ?
Must HTML source code be an ASCII code, or is it now allowed to be
UNICODE encoded text ?
thanks for any learned enlightment,

Patrick.

推荐答案

Patrick Van Esch写道:
Patrick Van Esch wrote:
那么,这个(学术性)讨论的结果应该是什么?
HTML源代码必须是ASCII代码,或者是它现在被允许是
UNICODE编码的文本吗?
So, what should be the outcome of this (academic) discussion ?
Must HTML source code be an ASCII code, or is it now allowed to be
UNICODE encoded text ?




HTML使用unicode。



HTML uses unicode.


在文章中< c2 ************************** @ posting.google.com>,
va ***** @ ill.fr (Patrick Van Esch)写道:
In article <c2**************************@posting.google.com >,
va*****@ill.fr (Patrick Van Esch) wrote:
那么,应该是什么这个(学术)讨论的结果?
So, what should be the outcome of this (academic) discussion ?




编辑为直字符(no&#...;)并保存为UTF-8(如

像你一样反对UTF-16; UTF-8比UTF-16更安全。

Microsoft等。拨打UTF-16 Unicode。


-

Henri Sivonen
hs ****** @ iki.fi
http://hsivonen.iki.fi/

Mozilla Web作者常见问题解答: http://mozilla.org/docs/web-developer/faq.html



Editing as straight characters (no &#...;) and saving as UTF-8 (as
opposed to UTF-16 like you were doing; UTF-8 is safer than UTF-16).
Microsoft et al. call UTF-16 Unicode.

--
Henri Sivonen
hs******@iki.fi
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html


在文章< ; c2 ************************** @ posting.google.com> ;,
In article <c2**************************@posting.google.com >,
必须HTML源代码为一个ASCII码,还是现在允许它是
UNICODE编码的文本?
Must HTML source code be an ASCII code, or is it now allowed to be
UNICODE encoded text ?




马的嘴(tm)位于: http://www.w3.org/TR/html4/charset.html

-

Peter Greenwood pe **** @ pgid。 co.uk
http:// ww w.pgid.co.uk

+44 1253 821678



The Horse''s Mouth (tm) is at: http://www.w3.org/TR/html4/charset.html
--
Peter Greenwood pe****@pgid.co.uk
http://www.pgid.co.uk
+44 1253 821678


这篇关于可以在unicode中指定HTML源文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆