Created
October 18, 2010 11:43
-
-
Save Eugeny/632080 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def fix_unicode(s): | |
d = '' | |
for i in range(0, len(s)): | |
if ord(s[i])<32: | |
d += ' ' | |
else: | |
d += s[i] | |
return unicode(d, errors='replace') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[x if ord(x)<32 else ' ' for x in s]