Python stringprep Library
Stringprep describes a framework for preparing Unicode text strings in order to increase the possibility that string input and string comparison work in ways that make sense for typical users throughout the world.
Some functions of stringprep discussed here are as follows:
1. stringprep.in_table_c21(code)
2. stringprep.in_table_c22(code)
3. stringprep.in_table_c21_c22(code)
1. stringprep.in_table_c21(code):
This function in python stringprep library returns "True" or "False" depending on whether the given Unicode code point passed as argument is listed in the Table C.2.1.
This Table C.2.1 contains the ASCII control characters.
This table has entries for the control characters ranging from "U+0000 to U+001F and "U+007F" for the delete character.
To view the table visit: https://datatracker.ietf.org/doc/html/rfc3454#appendix-C.2.1
EXAMPLE:
2. stringprep.in_table_c22(code):
This function in python stringprep library returns "True" or "False" depending on whether the given Unicode code point passed as argument is listed in the Table C.2.2.
This Table C.2.2 contains the Non-ASCII control characters.
This table has characters such as ARABIC END OF AYAH, MONGOLIAN VOWEL SEPERATOR, LINE SEPERATOR, etc..
To view the table visit: https://datatracker.ietf.org/doc/html/rfc3454#appendix-C.2.2
EXAMPLE:
3. stringprep.in_table_c21_c22(code):
This function in python stringprep library returns "True" or "False" depending on whether the given Unicode code point passed as argument is listed in the Table C.2.
This Table C.2 contains two tables for all the control characters whether it is ASCII or Non-ASCII.
It has two tables Table C.2.1 (that contains ASCII control characters) and Table C.2.2 (that contains Non-ASCII control characters). Thus Table C.2 is the union table for Table C.2.1 and Table C.2.2.
To view the table visit: https://datatracker.ietf.org/doc/html/rfc3454#appendix-C.2
EXAMPLE:
Comments