class unicode_tr(str):
    CHARMAP = {'to_upper': {'\u0131': 'I', 'i': '\u0130'}, 'to_lower':
        {'I': '\u0131', '\u0130': 'i'}}

def lower(self):
    for key, value in list(self.CHARMAP.get('to_lower').items()):
        self = self.replace(key, value)
return self.lower()

def upper(self):
    for key, value in list(self.CHARMAP.get('to_upper').items()):
        self = self.replace(key, value)
return self.upper()
if __name__ == '__main__':
    print(unicode_tr('kitap').upper())
print(unicode_tr('K\xc4\xb0TAP').lower())
Python UTF-8 Lowercase Turkish Specific Letter