当前位置:网站首页>#yyds干货盘点#stringprep --- 因特网字符串预备
#yyds干货盘点#stringprep --- 因特网字符串预备
2022-04-23 18:41:00 【D八哥卷】
在标识因特网上的事物(例如主机名),经常需要比较这些标识是否(相等)。 这种比较的具体执行可能会取决于应用域的不同,例如是否要区分大小写等等。 有时也可能需要限制允许的标识为仅由“可打印”字符组成。
RFC 3454 定义了在因特网协议中 Unicode 字符串的“预备”过程。 在将字符串连线传输之前,它们会先使用预备过程进行处理,之后它们将具有特定的标准形式。 该 RFC 定义了一系列表格,它们可以被组合为选项配置。 每个配置必须定义所使用的表格,stringprep 过程的其他可选项也是配置的组成部分。 stringprep 配置的一个例子是 nameprep,它被用于国际化域名。模块 stringprep 仅公开了来自 RFC 3454 的表格。 由于这些如果表格如果表示为字典或列表将会非常庞大,该模块在内部使用 Unicode 字符数据库。 该模块本身的源代码是使用 mkstringprep.py 工具生成的。因此,这些表格以函数而非数据结构的形式公开。 在 RFC 中有两种表格:集合与映射。 对于集合,stringprep 提供了“特征函数”,即如果形参是集合的一部分则返回值为 True 的函数。 对于映射,它提供了映射函数:它会根据给定的键返回所关联的值。 以下是模块中所有可用函数的列表。stringprep.in_table_a1(code)
确定 code 是否属于 tableA.1 (Unicode 3.2 中的未分配码位)。
stringprep.in_table_b1(code)
确定 code 是否属于 tableB.1 (通常映射为空值)。
stringprep.map_table_b2(code)
返回 code 依据 tableB.2 (配合 NFKC 使用的大小写转换映射) 所映射的值。
stringprep.map_table_b3(code)
返回 code 依据 tableB.3 (不附带正规化的大小写折叠映射) 所映射的值。
stringprep.in_table_c11(code)
确定 code 是否属于 tableC.1.1 (ASCII 空白字符)。
stringprep.in_table_c12(code)
确定 code 是否属于 tableC.1.2 (非 ASCII 空白字符)。
stringprep.in_table_c11_c12(code)
确定 code 是否属于 tableC.1 (空白字符,C.1.1 和 C.1.2 的并集)。
stringprep.in_table_c21(code)
确定 code 是否属于 tableC.2.1 (ASCII 控制字符)。
stringprep.in_table_c22(code)
确定 code 是否属于 tableC.2.2 (非 ASCII 控制字符)。
stringprep.in_table_c21_c22(code)
确定 code 是否属于 tableC.2 (控制字符,C.2.1 和 C.2.2 的并集)。
stringprep.in_table_c3(code)
确定 code 是否属于 tableC.3 (私有使用)。
stringprep.in_table_c4(code)
确定 code 是否属于 tableC.4 (非字符码位)。
stringprep.in_table_c5(code)
确定 code 是否属于 tableC.5 (替代码)。
stringprep.in_table_c6(code)
确定 code 是否属于 tableC.6 (不适用于纯文本)。
stringprep.in_table_c7(code)
确定 code 是否属于 tableC.7 (不适用于规范表示)。
stringprep.in_table_c8(code)
确定 code 是否属于 tableC.8 (改变显示属性或已弃用)。
stringprep.in_table_c9(code)
确定 code 是否属于 tableC.9 (标记字符)。
stringprep.in_table_d1(code)
确定 code 是否属于 tableD.1 (带有双向属性 "R" 或 "AL" 的字符)。
stringprep.in_table_d2(code)
确定 code 是否属于 tableD.2 (带有双向属性 "L" 的字符)。
版权声明
本文为[D八哥卷]所创,转载请带上原文链接,感谢
https://blog.51cto.com/u_15477882/5248714
边栏推荐
- Setting up keil environment of GD single chip microcomputer
- After CANopen starts PDO timing transmission, the heartbeat frame time is wrong, PDO is delayed, and CANopen time axis is disordered
- Introduction to quantexa CDI syneo platform
- ESP32 LVGL8. 1 - input devices (input devices 18)
- Deeply understand what new and make in golang are and what are the differences?
- ctfshow-web361(SSTI)
- Const keyword, variable and function are decorated with const
- 解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
- Creation and use of QT dynamic link library
- 使用晨曦记账本,分析某个时间段每个账户收支结余
猜你喜欢

Query the logistics update quantity according to the express order number

Solution to Chinese garbled code after reg file is imported into the registry

Summary of actual business optimization scheme - main directory - continuous update

机器学习理论之(7):核函数 Kernels —— 一种帮助 SVM 实现非线性化决策边界的方式

函数递归以及趣味问题的解决

ESP32 LVGL8. 1 - roller rolling (roller 24)

On iptables

iptables初探

WiFi ap6212 driver transplantation and debugging analysis technical notes

纠结
随机推荐
In shell programming, the shell file with relative path is referenced
WiFi ap6212 driver transplantation and debugging analysis technical notes
Ctfshow - web362 (ssti)
Summary of actual business optimization scheme - main directory - continuous update
迁移学习进阶
ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)
Excel intercept text
Promote QT default control to custom control
Configure iptables
Advanced transfer learning
MVVM模型
ESP32 LVGL8. 1 - roller rolling (roller 24)
Résolution: cnpm: impossible de charger le fichier... Cnpm. PS1 parce que l'exécution de scripts est désactivée sur ce système
SQL中函数 decode()与 replace()的用法
C language simulates entering and leaving the stack, first in first out, first in first out, shared memory
Mysqldump backup database
Creation and use of QT dynamic link library
os_ authent_ Prefix
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
Kettle paoding jieniu Chapter 17 text file output