Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
Python语言及其应用(第2版)
by
Bill Lubanovic
March 2022
Intermediate to advanced
522 pages
13h 52m
Chinese
Posts & Telecom Press
Content preview from
Python语言及其应用(第2版)
188
|
第
12
章
12.1
文本字符串
:
Unicode
第
5
章介绍过
Python
字符串的基础知识,现在是时候真正深入了解
Unicode
了。
Python 3
的字符串是
Unicode
字符序列,而非字节数组
。到目前为止,这是从
Python 2
到
Python 3
最大的变化。
目前本书所有的文本示例全都是普通的
ASCII
(
American Standard Code for Information
Interchange
,美国信息交换标准代码)。
ASCII
定义于
20
世纪
60
年代
,可谓十足的“老古
董”了。那时计算机有冰箱大小,多少算是有那么点儿智能。
计算机的基本存储单元是
字节
,一字节有
8
位,可以存储
256
个不同的值
。由于各种原
因,
ASCII
只用到了
7
位(
128
种取值):
26
个大写字母
、
26
个小写字母、
10
个数字、若
干标点符号、若干空白字符,以及若干非打印控制代码。
可惜这个世界并不是只有
ASCII
提供的这些字符。否则
,你倒是可以在餐馆点热狗,但无
法在咖啡厅点
Gewürztraminer
1
。为了能让一字节编码更多的字母和符号,人们付出了大量
的努力,你有时候还会看到这些成果。其中包括:
•
Latin-1
或
ISO 8859-1
;
•
Windows
编码页
1252
。
以上解决方案使用了一字节中全部的
8
位,但
即便如此,还是不够用,尤其是对于非欧洲
语言。
Unicode
是一个持续发展的国际标准,定义了世界上所有语言的字符
,以及数学和
其他领域的各种符号。甚至还有
emojis
表情符号!
Unicode
为每个字符提供了唯一的编码数字,无论具体的平台、程序和语言是什么。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
Python编程入门与实战
Posts & Telecom Press, Fabrizio Romano
Python实用技能学习指南
Posts & Telecom Press, Robert Smallshire, Austin Bingham
Python技术基础视频教程
保罗·J·戴特尔
Python面向对象编程指南
Posts & Telecom Press, Steven F. Lott
Publisher Resources
ISBN: 9787115586223