xbmc / vfs.rar

RAR VFS addon for Kodi
GNU General Public License v2.0
37 stars 24 forks source link

Extracting files with special characters #36

Open Cyriltra opened 5 years ago

Cyriltra commented 5 years ago

Hello,

I'm using vfs.rar to download .rar subtitles files from Chinese providers. I noticed when the archive contains chinese characters inside, the extraction (using xmbc.copy) does not work.

I'm using the below code to extract subtitles:

        path = urllib.quote_plus(archive)
        (dirs, files) = xbmcvfs.listdir('rar://%s' % (path))
        for file in files:
            file = file.decode('utf-8')
            src = 'rar://' + path + '/' + file
            dest = os.path.join(__temp__, file)
            xbmcvfs.copy(src, dest)

when the rar is downloaded, the code file = file.decode('utf-8') is changing Chinese characters to some weird characters: subtitle.name.DD5.1.H264-FGT.Ó¢ÎÄ.srt

however, when I download the exact same file on mac and extract the content, I can get all files with correct Chinese characters: subtitle.name.DD5.1.H264-FGT.英文.srt

Then, I compress these files on my mac in a new rar archive and provide it to my script and it's working all fine => file = file.decode('utf-8') is displaying subtitle.name.DD5.1.H264-FGT.英文.srt and i can extract all subtitles.

So I don't understand what is wrong...

In attachment, I provide the 2 rar archives (I just added .zip to be able to upload them on github):

original.rar.zip => the original rar archive downloaded from the subtitle provider files repacked.rar.zip => the archive I created on my mac, using the files I extracted from the original archive. I did not open or modified any of these files.

files repacked.rar.zip original.rar.zip

Thank you

taxigps commented 5 years ago

This should have been fixed with 2.0.7.

AlwinEsch commented 4 years ago

@Cyriltra can you confirm that it works on latest versions?

AlwinEsch commented 4 years ago

The new version is released:

Can the fix be confirmed?

Cyriltra commented 4 years ago

Hi, sorry I can't test, I'm using CoreElec 9.2.1, but their version of vfs.rar is really old. unless you have the addon zip ready ?

AlwinEsch commented 4 years ago

@Cyriltra How looks now and newer version available on CoreElec?