valueerror: all strings must be xml compatible: unicode or ascii, no null bytes or control characters
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
valueerror: all strings must be xml compatible: unicode or ascii, no null bytes or control characters
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
valueerror: all strings must be xml compatible: unicode or ascii, no null bytes or control characters
def valid_xml_char_ordinal(c):
codepoint = ord(c)
# conditions ordered by presumed frequency
return (
0x20 <= codepoint <= 0xD7FF or
codepoint in (0x9, 0xA, 0xD) or
0xE000 <= codepoint <= 0xFFFD or
0x10000 <= codepoint <= 0x10FFFF
)
valueerror: all strings must be xml compatible: unicode or ascii, no null bytes or control characters
cleaned_string = ''.join(c for c in input_string if valid_xml_char_ordinal(c))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us