Created
March 26, 2014 21:56
-
-
Save apeiros/9794494 to your computer and use it in GitHub Desktop.
Regex, encodings, invalid sequences
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
#p(/\xff/.encoding) # -> raises SyntaxError, "invalid multibyte escape: /\xff/" | |
p(/\xff/n.encoding) | |
#p(/\xff/u.encoding) # -> raises SyntaxError, "invalid multibyte escape: /\xff/" | |
p(/x/.encoding) | |
p(/x/n.encoding) | |
p(/x/u.encoding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: binary | |
p(/\xff/.encoding) | |
p(/\xff/n.encoding) | |
#p(/\xff/u.encoding) # -> raises SyntaxError, "invalid multibyte escape: /\xff/" | |
p(/x/.encoding) | |
p(/x/n.encoding) | |
p(/x/u.encoding) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment