1

I have exported some excel files from oracle pl database and now when I open it with excel or from python pandas I see string in this form: ÎÀÎÓÀØÅÈÊÈ and it should be like: პაპუაშვილი.

I have tried all the string.encode(encoding).decode(decoding) pairs from encodings.aliases, and can not get the desired result.

What I figured out so far is that

''.join(list(map(lambda x: chr(ord(x) + 4112), "ÎÀÎÓÀØÅÈÊÈ")))

gives me this string Can I have some custom encoding or is there any way so I do not have to call this method every time?

  • you'll need to find out the encoding used... or detect it somehow – Will May 30 '19 at 13:38
  • I loop over all encodings and there was not such one – Vitali Muladze May 30 '19 at 13:39
  • somewhere between oracle and excel the data was incorrectly encoded/decoded/encoded/decoded – Will May 30 '19 at 13:42
  • In excel I can choose a font and declare it correctly. I have a .ttf file can you tell me how can I use it? – Vitali Muladze May 30 '19 at 13:45
  • 1
    nothing to do with the font. All to do with the encoding of the raw data. – Will May 30 '19 at 13:48
  • desired_word = ''.join(list(map(lambda x: chr(ord(x) + 4112), unknown_word))) for encoding, _ in aliases.items(): for decoding, _ in aliases.items(): if encoding == decoding: continue try: converted_word = unknown_word.encode(encoding).decode(decoding) if converted_word == desired_word: print(converted_word, encoding, decoding) except Exception: continue – Vitali Muladze May 30 '19 at 13:50
  • Here it is there is not desired encoding decoding. Is there any way? – Vitali Muladze May 30 '19 at 13:50
  • custom codec? https://stackoverflow.com/questions/38777818/how-do-i-properly-create-custom-text-codecs – Will May 30 '19 at 13:54

0 Answers0