使用windows-1252代码页的缺点? [英] Disadvantages of using windows-1252 codepage?

查看:87
本文介绍了使用windows-1252代码页的缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们即将上线ASP.Net网站。我们发现使用windows-1252内容编码最简单的是
,因为那个

解决了一些特殊字符的问题。使用这个代码页是否有一些

一般的缺点(我知道大多数网站使用

utf-8或iso) - 我在考虑像搜索引擎这样的东西

不兼容 - 或者是否可以使用1252?


感谢您提前提示,


问候

DC

We are about to go online with an ASP.Net site. We have found that it
is easiest for us to use windows-1252 content encoding, since that
solves our problems with some special characters. Are there some
general disadvantages about using this codepage (most sites I know use
utf-8 or iso) - I am thinking of things like search engine
incompatibilities - or should it be OK to use 1252?

Thanks for any hint in advance,

Regards
DC

推荐答案

windows-1252代码页中的字符不同(0x80到

0x9F),显然你想要使用它的原因,大多数浏览器都无法识别,并且不受HTML标准的支持。你会做得更好

使用标准的UTF-8编码,并使用HTML-Encoding来获得特殊的

字符。


任何字符都可以使用

HTML中的& #number序列进行HTML编码,其中number是是字符的数值。对于

示例,''?''将被HTML编码为&#228。另外,你可以使用

System.Web.HttpServerUtility.HtmlEncode(或

System.Web.HttpUtility.HtmlEncode)方法来确保任何文本块

是正确的HTML编码,无需对单个

字符进行HTML编码,或者知道它们的数值。只有非法的HTML字符才会被编码。类似地,可以使用HttpDecode方法将文本块解码回其原始状态。


-

HTH,


Kevin Spencer

微软MVP

专业鸡肉沙拉炼金术士


我回收。

我把所有东西都送回它来自的星球。


DC < dc@upsize.de>在消息中写道

news:11 ********************* @ u72g2000cwu.googlegro ups.com ...
The characters in the windows-1252 code page that are different (0x80 to
0x9F), and apparently the reason you want to use it, are not recognized by
most browsers, and are not supported by HTML standards. You would do better
to use the standard UTF-8 encoding, and use HTML-Encoding for special
characters.

Any character can be HTML-Encoded by using the &#number sequence in the
HTML, in which "number" is the numerical value of the character. For
example, ''?'' would be HTML-Encoded as &#228. In addition, you can use the
System.Web.HttpServerUtility.HtmlEncode (or the
System.Web.HttpUtility.HtmlEncode) method to ensure that any block of text
is properly HTML-encoded, without having to HTML-encode individual
characters, or know their numeric values. Only illegal HTML characters will
be encoded. Similarly, blocks of text can be decoded back into their
original state using the HttpDecode method.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

"DC" <dc@upsize.de> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
我们即将上线ASP.Net网站。我们发现它对我们来说最容易使用windows-1252内容编码,因为它解决了一些特殊字符的问题。使用这个代码页有一些一般的缺点(我知道大多数网站都使用
utf-8或iso) - 我在考虑搜索引擎不兼容等问题 - 或者应该可以使用1252?

提前感谢提示,

DC
DC
We are about to go online with an ASP.Net site. We have found that it
is easiest for us to use windows-1252 content encoding, since that
solves our problems with some special characters. Are there some
general disadvantages about using this codepage (most sites I know use
utf-8 or iso) - I am thinking of things like search engine
incompatibilities - or should it be OK to use 1252?

Thanks for any hint in advance,

Regards
DC



这样写凯文,
Thus wrote Kevin,
windows-1252代码页中不同的字符(0x80
到0x9F),显然你想要使用它的原因是不被大多数浏览器识别,并且HTML标准不支持。


它们是常规的Unicode字符,因此可以表示为HTML实体。

否则,页面如 http://www.microsoft.com/globaldev/r...sbcs/1252.mspx

不存在;-)


此外,Windows-1252已在IANA注册,并在许多平台上得到支持。

实际上,我认为没有现代平台不能为Windows-1252提供

支持。

您最好使用标准的UTF-8编码,并使用
HTML-Encoding作为特殊字符。
The characters in the windows-1252 code page that are different (0x80
to 0x9F), and apparently the reason you want to use it, are not
recognized by most browsers, and are not supported by HTML standards.
They are regular Unicode characters and thus can be represented as HTML entities.
Otherwise, a page like http://www.microsoft.com/globaldev/r...sbcs/1252.mspx
couldn''t exist ;-)

Also, Windows-1252 is registered with IANA, and supported on many platforms.
Actually, I would assume that there''s no modern platform that doesn''t offer
support for Windows-1252.
You would do better to use the standard UTF-8 encoding, and use
HTML-Encoding for special characters.




我不会不同意:-)


干杯,

-

Joerg Jooss
ne ******** @ joergjooss.de


>此外,Windows-1252已在IANA注册,并在许多
> Also, Windows-1252 is registered with IANA, and supported on many
平台上受支持。实际上,我认为没有现代平台没有为Windows-1252提供支持。


平台?当然。浏览器?没有。


-

HTH,

Kevin Spencer

Microsoft MVP

专业鸡肉沙拉炼金术士


我回收利用。

我把一切都送回来自它的星球。


" Joerg Jooss" <是ne ******** @ joergjooss.de>在留言中写道

news:94 ************************** @ msnews.microsoft .com ...写了凯文,
platforms. Actually, I would assume that there''s no modern platform that
doesn''t offer support for Windows-1252.

Platforms? Sure. Browsers? No.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:94**************************@msnews.microsoft .com... Thus wrote Kevin,
windows-1252代码页中不同的字符(0x80
到0x9F),显然你想要使用它的原因,不是<大多数浏览器都认可,HTML标准不支持。
The characters in the windows-1252 code page that are different (0x80
to 0x9F), and apparently the reason you want to use it, are not
recognized by most browsers, and are not supported by HTML standards.



它们是常规的Unicode字符,因此可以表示为HTML
实体。否则,页面如
http:// www .microsoft.com / globaldev / r ... sbcs / 1252.mspx
不可能存在;-)

此外,Windows-1252已在IANA注册,并在许多
平台上得到支持。实际上,我认为没有现代平台不支持Windows-1252。



They are regular Unicode characters and thus can be represented as HTML
entities. Otherwise, a page like
http://www.microsoft.com/globaldev/r...sbcs/1252.mspx
couldn''t exist ;-)

Also, Windows-1252 is registered with IANA, and supported on many
platforms. Actually, I would assume that there''s no modern platform that
doesn''t offer support for Windows-1252.

你最好使用标准的UTF -8编码,并使用
HTML-Encoding用于特殊字符。
You would do better to use the standard UTF-8 encoding, and use
HTML-Encoding for special characters.



我不会不同意:-)

干杯,
-
Joerg Jooss
ne ******** @ joergjooss。 de



这篇关于使用windows-1252代码页的缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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