Bug 323601

Summary: Not handling French Characters
Product: [Fedora] Fedora Reporter: Brad <lazlow>
Component: par2cmdlineAssignee: Laurent Rineau <laurent.rineau__fedora>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-16 21:19:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Working example none

Description Brad 2007-10-08 19:14:51 UTC
Description of problem:Some of the rar files I get are from French speakers. If
the files have non-english characters (é) the par2 cannot find either the par
files or the rar file. Files from the same source without these character behave
normally.


Version-Release number of selected component (if applicable):0.4-11


How reproducible: Try to verify or repair files with the foreign (?) characters.


Steps to Reproduce:
1.par2 v filename
2.
3.
  
Actual results:file not found 


Expected results: verify file.


Additional info: Running a standard US install.

Comment 1 Laurent Rineau 2007-10-16 14:52:27 UTC
Brad, can you submit a testcase? upstream is almost dead. I hope the issue is 
easily fixable using iconv functions.


Comment 2 Brad 2007-10-16 16:15:07 UTC
Created attachment 228931 [details]
Working example

Here is a .nzb with a bad problem file name. The file reassembles and plays
just fine but the verification or repair does not work.

Comment 3 Laurent Rineau 2007-10-16 21:19:08 UTC
Actually, par2 processes file names as a byte stream. If your local system 
encodes filenames differently from the system on which the par2 files has been 
created, par2verify cannot find the files.

You have several options:
  - use same locale as the people that created the par2 files,
  - recode filenames locally, using "mvconv", for example. That tool is 
packaged in Fedora.

Upstream par2cmdline needs to create and process the optional PAR 2.0 packet 
named "PAR 2.0\0UniFileN" (see the PAR 2.0 specification).

I cannot fix that bug without upstream help, which is apparently dead.


Comment 4 Brad 2007-10-16 21:36:47 UTC
I think the tool you mean is convmv? If so, it just changes the name of the
files, which is not the problem. I THINK the problem is that the par2 file goes
looking for the file with the "goofy" character(coded within the par) and when
it does not find that exact character it fails. So:

1.Without contacting the originator how do I determine the encode used?

2. How do I change the locale in a manner that does not prevent me from using
the system(I do not R/W French)?

Thanks



Comment 5 Laurent Rineau 2007-10-16 21:51:19 UTC
You can use:
  convmv --nosmart -f utf8 -t iso-8859-1 *
on the files before calling par2, then use:
  convmv -f iso-8859-1 -t utf8 *
after.

The first command will convert the utf8 encoded filenames into latin-1 
encoding (eg. "é" instead of "é"). Your par2 files seems to look for latin-1 
encoded filenames.

I fully agree that it is far from being optimal, but adding Unicode support to 
par2cmdline is not a trivial job.


Comment 6 Brad 2007-10-16 22:04:16 UTC
Had to add the "--no test" but it worked.

Thanks