Skip to Content
Perl语言入门
book

Perl语言入门

by Randal L. Schwartz, brian d foy, Tom Phoenix
August 2018
Beginner to intermediate
382 pages
7h 14m
Chinese
Southeast University Press
Content preview from Perl语言入门
Unicode
入门
351
这和
é
的组合形式、分解形式相类似。
é
的两种表示方法实际上可说是完全等价
canonically equivalent
)的,因为不管如何构造这个字素,最终的视觉呈现和
字素意义都是相同的。但
fi
的视觉呈现并不相同,所以它们只是不完全等价
compatibility equivalent
)的。不管是完全等价还是不完全等价,我们都不需要关
心如何分解为方便排序的普通形式(见图
C-2
)。参见
Unicode Standard Annex
15
条,“
Unicode Normalization Forms
”,进一步了解其中细节。
C-
2
:我们可以分解并重新组合完全等价的字素表示形式,但只能分解不完全等价的字素表
示形式
比如你想要检查字符串中是否包含
é
或者
fi
,但并不关心原始用的是哪种字符表示
形式。首先,需要将字符串分解为普通形式,这好比是在做归一化。要分解
Unicode
字符串,得用
Perl
自带的
Unicode::Normalize
模块,它提供了两个分解字符串的函
数。你可以用
NFD
Normalization Form Decomposition
)子程序把完全等价形式的字
素转换为对应的分解形式。另外,也可以用
NFKD
Normalization Form Kompatibility
Decomposition
)子程序分解不完全等价的字素。下面例子中的字符串包含了组合字
符,之后再以不同方式分解后匹配。包含“
oops ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

计算机科学导论:跨学科方法

计算机科学导论:跨学科方法

罗伯特 塞奇威克, 凯文 韦恩
Perl语言入门(第8版)

Perl语言入门(第8版)

Randal L. Schwartz, brian d foy, Tom Phoenix

Publisher Resources

ISBN: 9787564177911