isAscii
Selects the first 128 characters of the Unicode character set,
corresponding to the ASCII character set.
O(n) Test whether
Text contains only ASCII code-points (i.e.
only U+0000 through U+007F).
This is a more efficient version of
all
isAscii.
>>> isAscii ""
True
>>> isAscii "abc\NUL"
True
>>> isAscii "abcd€"
False
isAscii t == all (< '\x80') t
O(n) Test whether
Text contains only ASCII code-points (i.e.
only U+0000 through U+007F).
This is a more efficient version of
all
isAscii.
>>> isAscii ""
True
>>> isAscii "abc\NUL"
True
>>> isAscii "abcd€"
False
isAscii t == all (< '\x80') t
Test whether
ShortText contains only ASCII
code-points (i.e. only U+0000 through U+007F).
This is a more efficient version of
all
isAscii.
>>> isAscii ""
True
>>> isAscii "abc\NUL"
True
>>> isAscii "abcd€"
False
isAscii t == all (< '\x80') t
Is this an ASCII character, i.e., the first 128 characters.
Selects ASCII lower-case letters, i.e. characters satisfying both
isAscii and
isLower.
Selects ASCII upper-case letters, i.e. characters satisfying both
isAscii and
isUpper.
Select alphabetic characters in the ascii character set.
Pre-release
Ascii letters and digits.
>>> isAsciiAlphaNum 'a'
True
>>> isAsciiAlphaNum 'ä'
False
Is this an ASCII Lower-case letter? i.e.,
a thru
z
>>> prove $ \c -> isAsciiLower c .<=> ord c .>= ord (literal 'a') .&& ord c .<= ord (literal 'z')
Q.E.D.
>>> prove $ \c -> isAsciiLower c .<=> isAscii c .&& isLowerL1 c
Q.E.D.
Is this an ASCII Upper-case letter? i.e.,
A thru
Z
>>> prove $ \c -> isAsciiUpper c .<=> ord c .>= ord (literal 'A') .&& ord c .<= ord (literal 'Z')
Q.E.D.
>>> prove $ \c -> isAsciiUpper c .<=> isAscii c .&& isUpperL1 c
Q.E.D.
Tests if
hostname contains segments with an
ASCII-compatible encoding of an Internationalized Domain Name. If this
returns
True, you should decode the hostname with
hostnameToUnicode before displaying it to the user.
Note that a hostname might contain a mix of encoded and unencoded
segments, and so it is possible for
hostnameIsNonAscii and
hostnameIsAsciiEncoded to both return
True for a name.
Since: 2.22
Determines if a string is pure ASCII. A string is pure ASCII if it
contains no bytes with the high bit set.
Since: 2.40