Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting files with special characters #36

Open
Cyriltra opened this issue Feb 16, 2019 · 5 comments
Open

Extracting files with special characters #36

Cyriltra opened this issue Feb 16, 2019 · 5 comments
Labels
Bug confirmed To define by dev that it was reproducable Bug fixed (user confirm missing) To define by dev that it seems fixed, but no user confirm now available Bug fixed To define by user or dev that related issue is finally fixed Typ: Bug To define by user as the related part not work, but Kodi can still be further used

Comments

@Cyriltra
Copy link

Cyriltra commented Feb 16, 2019

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
Copy link
Member

taxigps commented Apr 14, 2019

This should have been fixed with 2.0.7.

@AlwinEsch
Copy link
Member

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

@AlwinEsch
Copy link
Member

The new version is released:

  • 3.3.0-Matrix
  • 2.3.0-Leia

Can the fix be confirmed?

@Cyriltra
Copy link
Author

Cyriltra commented Apr 8, 2020

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 AlwinEsch added Bug confirmed To define by dev that it was reproducable Bug fixed To define by user or dev that related issue is finally fixed Typ: Bug To define by user as the related part not work, but Kodi can still be further used Bug fixed (user confirm missing) To define by dev that it seems fixed, but no user confirm now available labels Apr 18, 2020
@AlwinEsch
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug confirmed To define by dev that it was reproducable Bug fixed (user confirm missing) To define by dev that it seems fixed, but no user confirm now available Bug fixed To define by user or dev that related issue is finally fixed Typ: Bug To define by user as the related part not work, but Kodi can still be further used
Projects
None yet
Development

No branches or pull requests

3 participants