How to solve problem of non-ascii character on a zipfile on a plugin?

المشرف العام

Administrator
طاقم الإدارة
I'm making a plugin that needs extract files from a zipfile before processes them. For this I'm using zipfile lib.

The ZIP file contains filenames with non-ascii chars.

If I run this code on a "QGIS Terminal Python" it works.

import zipfile dir_orig = "C:\\Base_2015\\Corbelia\\Originais\\" fileZip = dir_orig + "Corbelia.zip" z = zipfile.ZipFile(fileZip) z.extractall(dir_orig) But on a plugin get the error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0x87 in position 7: ordinal not in range(128)

I already blew my big ant's brain but could not make it work.



أكثر...
 
أعلى