0

I got a InDesign page filled with 4 pictures. Im using

ex = os.popen('exiftool -T -IngredientsFilePath '+item).read()

to get back all pictures and their filepath used in that document

But when i try to write this answer into a file it seems the encoding went went wrong, or the answer from that command is already in any other encoding.

All ü,Ü,ä,Ä,ö,Ö,',',ß or spaces look like this : u%cc%88, o%cc%88, %c3%9f and so on.

Does anyone know how to fix this? At the moment im using .replace('%c3%9f', 'ß') for ex to get the right encoding but im not srsly lucky with that.

Greetings Yierith

Yierith
  • 141
  • 1
  • 5
  • 1
    You should really use subprocess – Padraic Cunningham Jan 15 '15 at 10:45
  • `ex` is a bytestring on Python 2. It is a Unicode string on Python 3. What does `print(repr(ex))` show? Unrelated: you could use `ex = subprocess.check_output(['exiftool', '-T', '-IngredientsFilePath', item])` (it doesn't solve the encoding issue) – jfs Jan 15 '15 at 17:00

0 Answers0