Show More
@@ -157,11 +157,12 b' def _buildlowerencodefun():' | |||||
157 | >>> f(b'the\\x07quick\\xADshot') |
|
157 | >>> f(b'the\\x07quick\\xADshot') | |
158 | 'the~07quick~adshot' |
|
158 | 'the~07quick~adshot' | |
159 | ''' |
|
159 | ''' | |
160 | cmap = dict([(chr(x), chr(x)) for x in xrange(127)]) |
|
160 | xchr = pycompat.bytechr | |
|
161 | cmap = dict([(xchr(x), xchr(x)) for x in xrange(127)]) | |||
161 | for x in _reserved(): |
|
162 | for x in _reserved(): | |
162 | cmap[chr(x)] = "~%02x" % x |
|
163 | cmap[xchr(x)] = "~%02x" % x | |
163 | for x in range(ord("A"), ord("Z") + 1): |
|
164 | for x in range(ord("A"), ord("Z") + 1): | |
164 | cmap[chr(x)] = chr(x).lower() |
|
165 | cmap[xchr(x)] = xchr(x).lower() | |
165 | def lowerencode(s): |
|
166 | def lowerencode(s): | |
166 | return "".join([cmap[c] for c in s]) |
|
167 | return "".join([cmap[c] for c in s]) | |
167 | return lowerencode |
|
168 | return lowerencode |
General Comments 0
You need to be logged in to leave comments.
Login now