search
HomeCommon ProblemWhat are the differences between unicode and ascii
What are the differences between unicode and asciiSep 06, 2023 am 11:56 AM
ascii codeunicodeascii

The differences between unicode and ascii include different encoding ranges, different storage spaces, and different compatibility. Detailed introduction: 1. The encoding range is different. The encoding range of ASCII is 0-127, which is mainly used to represent English letters. The encoding range of Unicode is much wider and can represent almost all language characters; 2. The storage space is different. ASCII usually Use 1 byte to store a character, while unicode may use 2 or more bytes to store a character; 3. Different compatibility, etc.

What are the differences between unicode and ascii

The operating system for this tutorial: Windows 10 system, DELL G3 computer.

1. What is Unicode

Unicode is a character encoding standard. Its goal is to set a small number of codes for every character in the world. It can accommodate characters of almost all languages ​​including English letters, Chinese characters, Japanese characters, Korean characters, Arabic numerals, etc.

2. What is ASCII

ASCII (American Standard Code for Information Interchange, American Standard Code for Information Interchange) is a character encoding based on English characters. It uses 7 bits to represent a character, and can represent a total of 128 different characters, including uppercase and lowercase English letters, Arabic numerals, punctuation marks, and some control characters.

3. The difference between Unicode and ASCII

The difference between unicode and ascii is mainly reflected in: 1. Different encoding ranges; 2. Storage space Different; 3. Different compatibility. In general, Unicode contains more characters than ASCII and can represent more languages.

1. Different coding ranges

The coding range of ASCII is 0-127, which is mainly used to represent English letters; while the coding range of Unicode is much wider and can represent almost all language characters.

2. Different storage spaces

ASCII encoding usually uses 1 byte to store a character, while Unicode encoding may use 2 or more bytes to store a character.

3. Different compatibility

ASCII encoding is part of Unicode encoding, that is to say, all ASCII characters have corresponding encodings in Unicode encoding. This also means that ASCII-encoded text can be converted directly to Unicode encoding without losing any information.

4. UTF8

  • So, in the spirit of conservation, UTF-8 encoding that converts Unicode encoding into "variable length encoding" appeared.
  • UTF-8 encoding encodes a Unicode character into 1-6 bytes according to different number sizes. Commonly used English letters are encoded into 1 byte. Chinese characters are usually 3 bytes, and only a few Uncommon characters will be encoded into 4-6 bytes. If the text you want to transmit contains a lot of English characters, using UTF-8 encoding can save space.
Characters ASCII Unicode UTF-8
A 01000001 00000000 01000001 01000001
中文 x 01001110 00101101 01001110 00101101
    ## From the above table, we can also find that UTF-8 encoding has an additional The advantage is that ASCII encoding can actually be regarded as part of UTF-8 encoding. Therefore, a large number of historical legacy software that only supports ASCII encoding can continue to work under UTF-8 encoding.

5. How common character encoding works in computers

    In the computer memory, Unicode encoding is used uniformly, and when it needs to be saved to the hard disk Or when it needs to be transmitted, convert it to UTF-8 encoding.
  • When editing with Notepad, the UTF-8 characters read from the file are converted into Unicode characters and stored in the memory. After the editing is completed, Unicode is converted into UTF-8 when saving. To the file:

  • What are the differences between unicode and ascii

  • When browsing the web, the server will convert the dynamically generated Unicode content into UTF-8 and then transmit it. To the browser:

  • What are the differences between unicode and ascii

The above is the detailed content of What are the differences between unicode and ascii. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
ASCII码对照表ASCII码对照表Jun 21, 2023 pm 05:36 PM

ASCII(American Standard Code for Information Interchange,美国信息互换标准代码)是一套基于拉丁字母的字符编码,共收录了 128 个字符,用一个字节就可以存储,它等同于国际标准 ISO/IEC 646。ASCII 规范于 1967 年第一次发布,最后一次更新是在 1986 年。

d的ascii码值是多少d的ascii码值是多少Feb 02, 2023 am 11:26 AM

d的ascii码值是100;因为a的ASCII代码值是十六进制数61H,即十进制值是97,而d在a后三位,则d的ASCII代码值是“97+3=100”;ASCII码使用指定的7位或8位二进制数组合来表示128或256种可能的字符。

一个ascii字符占几个字节一个ascii字符占几个字节Mar 09, 2023 pm 03:49 PM

一个ascii字符占1个字节。ASCII码字符在计算机中采用7位或8位二进制编码表示,并保存在一个字节中,即一个ASCII码占用一个字节。ASCII码可分为标准ASCII码和扩展ASCII码,其中标准ASCII码也叫基础ASCII码,使用7位二进制数(剩下的1位二进制为0)来表示所有的大写和小写字母,数字0到9、标点符号,以及在美式英语中使用的特殊控制字符。

一个ascii码占几个字节一个ascii码占几个字节Sep 07, 2023 pm 04:03 PM

一个ascii码占一个字节,ascii码是一种用于表示字符的编码标准,它使用7位二进制数来表示128个不同的字符,包括字母、数字、标点符号和特殊字符等。一个字节是计算机存储单位的基本单元,它由8个二进制位组成,每个二进制位可以是0或1,一个字节可以表示256个不同的数值,因此可以表示ascii码中的所有字符。

ascii码是什么意思ascii码是什么意思Jul 18, 2022 am 11:15 AM

ascii码是基于拉丁字母的一套电脑编码系统;ascii码是“American Standard Code for Information Interchange”的简写,主要用于显示现代英语和其他西欧语言,是最通用的信息交换标准,使用指定的7位或8位二进制数组合来表示128或256种可能的字符。

快速了解 PHP 中的 ASCII 数值转换快速了解 PHP 中的 ASCII 数值转换Mar 28, 2024 pm 06:42 PM

PHP中的ASCII数值转换是编程中经常会遇到的问题。ASCII(AmericanStandardCodeforInformationInterchange)是一种用于将字符转换为数字的标准编码系统。在PHP中,我们经常需要通过ASCII码来实现字符和数字之间的转换。本文将介绍如何在PHP中进行ASCII数值转换,并给出具体的代码示例。一、将字符

unicode怎么转中文unicode怎么转中文Dec 14, 2023 am 10:57 AM

Unicode是一种字符编码标准,用于表示各种语言和符号。要将Unicode编码转换为中文字符,可使用Python的内置函数chr()和ord()。

深入了解PHP:JSON Unicode转中文的实现方法深入了解PHP:JSON Unicode转中文的实现方法Mar 05, 2024 pm 02:48 PM

深入了解PHP:JSONUnicode转中文的实现方法在开发中,我们经常会遇到需要处理JSON数据的情况,而JSON中的Unicode编码在一些场景下会给我们带来一些问题,特别是当需要将Unicode编码转换为中文字符时。在PHP中,有一些方法可以帮助我们实现这个转换过程,下面将介绍一种常用的方法,并提供具体的代码示例。首先,让我们先了解一下JSON中Un

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)