Unicode和Ascii字符是否相同? [英] Are Unicode and Ascii characters the same?

查看:411
本文介绍了Unicode和Ascii字符是否相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是unicode字符代码?它们与ASCII字符有何不同?

What exactly are unicode character codes? And how are they different from ascii characters?

推荐答案

Unicode是一种为当今正在使用的几乎所有语言的字符以及许多其他字符(例如数学符号)分配唯一数字(称为代码点)的方法.有很多方法可以将Unicode字符串编码为字节,例如 UTF-8 UTF-16 .

Unicode is a way to assign unique numbers (called code points) to characters from nearly all languages in active use today, plus many other characters such as mathematical symbols. There are many ways to encode Unicode strings as bytes, such as UTF-8 and UTF-16.

ASCII仅将值分配给128个字符(a-z,A-Z,0-9,空格,一些标点符号和一些控制字符).

ASCII assigns values only to 128 characters (a-z, A-Z, 0-9, space, some punctuation, and some control characters).

对于每个具有ASCII值的字符,其Unicode代码点和该字符的ASCII值都相同.

For every character that has an ASCII value, the Unicode code point and the ASCII value of that character are the same.

在大多数现代应用程序中,您应该更喜欢使用Unicode字符串而不是ASCII.例如,这将使您可以在用户的​​名称或地址中使用带重音符号的用户,并将您的界面本地化为英语以外的其他语言.

In most modern applications you should prefer to use Unicode strings rather than ASCII. This will for example allow you to have users with accented characters in their name or address, and to localize your interface to languages other than English.

这篇关于Unicode和Ascii字符是否相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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