Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created October 18, 2010 11:43
Show Gist options
  • Save Eugeny/632080 to your computer and use it in GitHub Desktop.
Save Eugeny/632080 to your computer and use it in GitHub Desktop.
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')
@Bryukh
Copy link

Bryukh commented Oct 19, 2010

[x if ord(x)<32 else ' ' for x in s]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment