当前位置:网站首页>Yyds dry goods inventory stringprep --- Internet string preparation

Yyds dry goods inventory stringprep --- Internet string preparation

2022-04-23 18:48:00 D starling roll

Identifying things on the Internet ( For example, host name ), It is often necessary to compare whether these marks are ( equal ). The specific implementation of this comparison may depend on the application domain , For example, whether to be case sensitive, etc . Sometimes it may be necessary to limit the allowed identification to only “ Printable ” Character composition .

RFC 3454  Defined in the internet protocol Unicode A string of “ get set ” The process . Before the string is wired for transmission , They will be processed first using the preparatory process , Then they will have a specific standard form . The RFC Defines a series of tables , They can be combined into option configurations . Each configuration must define the table used ,stringprep  Other options for the process are also part of the configuration . stringprep  An example of configuration is  nameprep, It is used to internationalize domain names . modular  ​​stringprep​​  Only from  RFC 3454  Table for . Because if these tables are represented as dictionaries or lists, they will be very large , The module is used internally Unicode Character database . The source code of the module itself is  mkstringprep.py  Tool generated . therefore , These tables are exposed as functions rather than data structures . stay RFC There are two kinds of tables in : Set and map . For collection ,​​stringprep​  Provides “ The characteristic function ”, That is, if the formal parameter is part of the set, the return value is  True  Function of . For mapping , It provides mapping functions : It will return the associated value according to the given key . The following is a list of all available functions in the module .stringprep.in_table_a1(code)

determine  code  Whether to belong to tableA.1 (Unicode 3.2 Unallocated code points in ).

stringprep.in_table_b1(code)

determine  code  Whether to belong to tableB.1 ( Usually mapped to null values ).

stringprep.map_table_b2(code)

return  code  basis tableB.2 ( coordination NFKC Use case conversion mapping ) Mapped values .

stringprep.map_table_b3(code)

return  code  basis tableB.3 ( Case collapse mapping without normalization ) Mapped values .

stringprep.in_table_c11(code)

determine  code  Whether to belong to tableC.1.1 (ASCII Blank character ).

stringprep.in_table_c12(code)

determine  code  Whether to belong to tableC.1.2 ( Not ASCII Blank character ).

stringprep.in_table_c11_c12(code)

determine  code  Whether to belong to tableC.1 ( Blank character ,C.1.1 and C.1.2 Union ).

stringprep.in_table_c21(code)

determine  code  Whether to belong to tableC.2.1 (ASCII Control characters ).

stringprep.in_table_c22(code)

determine  code  Whether to belong to tableC.2.2 ( Not ASCII Control characters ).

stringprep.in_table_c21_c22(code)

determine  code  Whether to belong to tableC.2 ( Control characters ,C.2.1 and C.2.2 Union ).

stringprep.in_table_c3(code)

determine  code  Whether to belong to tableC.3 ( Private use ).

stringprep.in_table_c4(code)

determine  code  Whether to belong to tableC.4 ( Non character code point ).

stringprep.in_table_c5(code)

determine  code  Whether to belong to tableC.5 ( Substitute code ).

stringprep.in_table_c6(code)

determine  code  Whether to belong to tableC.6 ( Not applicable to plain text ).

stringprep.in_table_c7(code)

determine  code  Whether to belong to tableC.7 ( Not applicable to the specification representation ).

stringprep.in_table_c8(code)

determine  code  Whether to belong to tableC.8 ( Changed display properties or deprecated ).

stringprep.in_table_c9(code)

determine  code  Whether to belong to tableC.9 ( Mark characters ).

stringprep.in_table_d1(code)

determine  code  Whether to belong to tableD.1 ( With bidirectional properties "R" or "AL" The characters of ).

stringprep.in_table_d2(code)

determine  code  Whether to belong to tableD.2 ( With bidirectional properties "L" The characters of ).

版权声明
本文为[D starling roll]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231823467372.html