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_d1(code)
2. stringprep.in_table_d2(code)
These functions check if the argument passed here is present in the Table D.1 and D.2 and both these tables are for the Bidirectional characters.
Each character in Unicode has an associated directional property. Most characters are strongly typed as LTR(left to Right) or RTL(right to left). Many different types of directional properties are described in Unicode and these properties are used by the Web Browsers to render the text correctly.
1. stringprep.in_table_d1(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 D.1.
This Table D.1 contains the characters with bidirectional property "R" or "AL".
To view the table visit: https://datatracker.ietf.org/doc/html/rfc3454#appendix-D.1
2. stringprep.in_table_d2(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 D.2.
This Table D.2 contains the characters with bidirectional property "L".
To view the table visit: https://datatracker.ietf.org/doc/html/rfc3454#appendix-D.2
Comments