Mon, 11 Jan 2016 18:29:14 +0200
More Python 3 support
#!/usr/bin/env python3 # encoding: utf-8 ''' Provides the munge function. ''' import string mungechars = 'аɓᴄđеƒɡɦіјķɭṁɳорqŗѕƫᴜᴠᴡхуᴢАВСḌЕḞǴНІЈКLМΝОРQɌЅТÙⅤⱲХΥΖ' mungedict = dict (zip (string.ascii_lowercase + string.ascii_uppercase, mungechars)) def mungeone (ch): ''' Munges one character. ''' try: return mungedict[ch] except: return ch def munge (a): ''' Munges the given string ''' return ''.join (mungeone(ch) for ch in a)