Changing filenames from Greeklish => Greek (subprocess complain)

Νικόλαος Κούρας nikos.gr33k at gmail.com
Tue Jun 4 09:49:26 EDT 2013


>Steven said:
>It looks like your client is ignoring the charset header, and 
>interpreting the bytes as Latin-1 when they are actually ISO-8859-7. 

>py> s = 'Eυχή του Ιησού.mp3' 
>py> print(s.encode('ISO-8859-7').decode('latin-1')) 
>Eõ÷Þ ôïõ Éçóïý.mp3 

>which matches what you see. If you can manually tell your client to use 
>ISO-8859-7, you should see it correctly. 

I think this is the case too Steven, but it suprises me to see that Chrome ignores the charset header. 

Actually when i told explicitly Chrome to display everythign as utf-8 it presented the filaname properly. 

py> print(s.encode('ISO-8859-7').decode('latin-1')) 

Why you are encoding the 's' string to greek-iso? 
Isn't it set by itself in greek-iso since it uses greek-iso lettering?
I think you are very close to solution but i cannot clearly see it yet.



More information about the Python-list mailing list