Hello,
I am trying to run par2 to repair an archive that has an apostrophe in the name. Not a single quote. This archive was created on Windows.
File name should be Joe’s file.part01.rar
If I do ls I get Joe?s file.part01.rar
ls -b I get Joe\302\222s\ file.part01.rar
Running par2 *.par2 runs par2 cmdline but all the files are missing and par2 says all the files are missing.
Target: "Joe’s file.part01.rar" - missing. Target: "Joe’s file.part02.rar" - missing. Target: "Joe’s file.part03.rar" - missing. Target: "Joe’s file.part04.rar" - missing.
Doesn't see the repair files either.
How can I escape these characters or run the program? I have searched for a day to see how to run this program. I have seen others ask the same question as well.
Is there a way to use 'exec' or another option?
I have tried to change the terminal character set with no luck or just haven't found the correct character set yet.
I cannot rename the files as the par2 and repair files look for the original file names.
I don't even know how to enter the characters in the terminal.
I notice if I look at the file name in a graphics file manager (dolphin), I just get a square with some unreadable code in it. Same if I try to look at it in a directory listing from a program. Am I missing a font set for this and would that make it work better.
As I cannot confirm the language the file was created in, I may be missing the correct font on my system to work with it as well.
Robin
On 14May2016 18:25, Robin Laing MeSat@TelusPlanet.net wrote:
I am trying to run par2 to repair an archive that has an apostrophe in the name. Not a single quote. This archive was created on Windows.
Is there any reason you can't just rename the file by hand, with "mv"? Or is this to fix some automation?
File name should be Joe’s file.part01.rar
If I do ls I get Joe?s file.part01.rar
ls -b I get Joe\302\222s\ file.part01.rar
What are your locale settings? What does the output of "locale" say?
The locale settings affect several things; in particular it affects:
- what ls will show you, because it affects what "ls" considers a printable character
- what your terminal displays for various byte sequences (this is driven by the terminal emulator's idea of your local, not your shell, but they should match)
- what your keystrokes mean
Running par2 *.par2 runs par2 cmdline but all the files are missing and par2 says all the files are missing.
Target: "Joe’s file.part01.rar" - missing. Target: "Joe’s file.part02.rar" - missing. Target: "Joe’s file.part03.rar" - missing. Target: "Joe’s file.part04.rar" - missing.
That is very weird. Normally, saying "*.rar" should be a totally robust thing to say. On the other hand, it is possible that those strings above are from inside the archive specification, and that is why they are not found: your files need renaming as you anticipate.
No matter...
Doesn't see the repair files either. How can I escape these characters or run the program? I have searched for a day to see how to run this program. I have seen others ask the same question as well. Is there a way to use 'exec' or another option?
I have tried to change the terminal character set with no luck or just haven't found the correct character set yet.
I cannot rename the files as the par2 and repair files look for the original file names.
I don't even know how to enter the characters in the terminal.
I notice if I look at the file name in a graphics file manager (dolphin), I just get a square with some unreadable code in it.
That means it is not decoding the filename into characters for which is has a glyph. That just means that Windows was using some other codeset whn it was saving the filenames into the archive. Windows is a bit of a nightmare in this regard.
Same if I try to look at it in a directory listing from a program. Am I missing a font set for this and would that make it work better.
No. You've got a character encoding issue.
However, there is a way out. Get your error message above into your terminal, specificly by running your command again to ensure it is exact. Then use cut/paste in your terminal to effect 4 mv commands. So, like this:
mv *.part01.rar '<paste-filename-1-from-the-error-message-here>'
so you're:
- using the shell to match the _current_ first file with *.part01.rar
- you are typing a single quote, then pasting the filename from the error message, then another single quote
Provided the desired filenames' quote _is_ an apostrophe and not an ASCII single quote, you should be ok here. This is because your terminal has transcribed the error string from par2, and hopefully that will be usable.
This avoids figuring out how to type a weird filename.
There are other ways to approach this, but if this work it is probably the easiest.
As I cannot confirm the language the file was created in, I may be missing the correct font on my system to work with it as well.
This is not a font issue.
Try the above and report.
Cheers, Cameron Simpson cs@zip.com.au
On 14/05/16 21:55, cs@zip.com.au wrote:
On 14May2016 18:25, Robin Laing MeSat@TelusPlanet.net wrote:
I am trying to run par2 to repair an archive that has an apostrophe in the name. Not a single quote. This archive was created on Windows.
Is there any reason you can't just rename the file by hand, with "mv"? Or is this to fix some automation?
Par2 will pull the file name from the par2 file that it is supposed to repair. Par2 will run but if the file name is wrong, then it won't repair the archive. I know that there are issues with the archive.
File name should be Joe’s file.part01.rar
If I do ls I get Joe?s file.part01.rar
ls -b I get Joe\302\222s\ file.part01.rar
What are your locale settings? What does the output of "locale" say?
The locale settings affect several things; in particular it affects:
- what ls will show you, because it affects what "ls" considers a
printable character
- what your terminal displays for various byte sequences (this is
driven by the terminal emulator's idea of your local, not your shell, but they should match)
- what your keystrokes mean
I have tried different locales with no success. Not sure of which one I need.
LANG=en_CA.UTF-8 LC_CTYPE="en_CA.UTF-8" LC_NUMERIC="en_CA.UTF-8" LC_TIME=en_GB.UTF-8 LC_COLLATE="en_CA.UTF-8" LC_MONETARY="en_CA.UTF-8" LC_MESSAGES="en_CA.UTF-8" LC_PAPER="en_CA.UTF-8" LC_NAME="en_CA.UTF-8" LC_ADDRESS="en_CA.UTF-8" LC_TELEPHONE="en_CA.UTF-8" LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=
I cannot remember which other locale I have tried. If I knew what the \302\222 locale came from or how they are encoded, then it would point me in the right direction. I have searched to find out those codes with no success. I know it is supposed to be a curly single quote.
Running par2 *.par2 runs par2 cmdline but all the files are missing and par2 says all the files are missing.
Target: "Joe’s file.part01.rar" - missing. Target: "Joe’s file.part02.rar" - missing. Target: "Joe’s file.part03.rar" - missing. Target: "Joe’s file.part04.rar" - missing.
That is very weird. Normally, saying "*.rar" should be a totally robust thing to say. On the other hand, it is possible that those strings above are from inside the archive specification, and that is why they are not found: your files need renaming as you anticipate.
No matter...
You are correct. They are what the par2 command is pulling from the par2 file.
Doesn't see the repair files either. How can I escape these characters or run the program? I have searched for a day to see how to run this program. I have seen others ask the same question as well. Is there a way to use 'exec' or another option?
I have tried to change the terminal character set with no luck or just haven't found the correct character set yet.
I cannot rename the files as the par2 and repair files look for the original file names.
I don't even know how to enter the characters in the terminal.
I notice if I look at the file name in a graphics file manager (dolphin), I just get a square with some unreadable code in it.
That means it is not decoding the filename into characters for which is has a glyph. That just means that Windows was using some other codeset whn it was saving the filenames into the archive. Windows is a bit of a nightmare in this regard.
I have read that in my searches today.
Same if I try to look at it in a directory listing from a program. Am I missing a font set for this and would that make it work better.
No. You've got a character encoding issue.
However, there is a way out. Get your error message above into your terminal, specificly by running your command again to ensure it is exact. Then use cut/paste in your terminal to effect 4 mv commands. So, like this:
mv *.part01.rar '<paste-filename-1-from-the-error-message-here>'
so you're:
using the shell to match the _current_ first file with *.part01.rar
you are typing a single quote, then pasting the filename from the
error message, then another single quote
Provided the desired filenames' quote _is_ an apostrophe and not an ASCII single quote, you should be ok here. This is because your terminal has transcribed the error string from par2, and hopefully that will be usable.
This avoids figuring out how to type a weird filename.
There are other ways to approach this, but if this work it is probably the easiest.
As I cannot confirm the language the file was created in, I may be missing the correct font on my system to work with it as well.
This is not a font issue.
Try the above and report.
mkd>
Cheers, Cameron Simpson cs@zip.com.au
Well done Cameron. Thank you.
Moving the files did help. I don't know why I didn't try that before. With everything else going on today, it must of slipped my mind. I started going in circles. I know I tried to move the files late last night but not with the paste like you suggested.
This will go in my notes for future reference if it happens again.
It is funny that the par2 program had no problem seeing the repair volume files with the glyph but couldn't see the rar files with the glyph.
Again, thank you.
Robin
On 14May2016 22:45, Robin Laing MeSat@TelusPlanet.net wrote:
On 14/05/16 21:55, cs@zip.com.au wrote:
However, there is a way out. Get your error message above into your terminal, specificly by running your command again to ensure it is exact. Then use cut/paste in your terminal to effect 4 mv commands. So, like this:
mv *.part01.rar '<paste-filename-1-from-the-error-message-here>'
so you're:
- using the shell to match the _current_ first file with *.part01.rar
- you are typing a single quote, then pasting the filename from the
error message, then another single quote
Provided the desired filenames' quote _is_ an apostrophe and not an ASCII single quote, you should be ok here. This is because your terminal has transcribed the error string from par2, and hopefully that will be usable.
This avoids figuring out how to type a weird filename.
[...]
Well done Cameron. Thank you. Moving the files did help. I don't know why I didn't try that before. With everything else going on today, it must of slipped my mind. I started going in circles. I know I tried to move the files late last night but not with the paste like you suggested.
The advantage of the paste is that par2 has recited the filenames for you to your terminal, so cut/paste gets to pick them up again verbatim in whatever encoding is in play.
BTW, with the locale the utf-8 bit is what matters for this: it dictates how character codepoints are encoded when written to your terminal and, for locale aware apps, how they are encoded when filename bytes are generated. It also ditates how things like "ls" decode those bytes and decide what is printable or otherwise.
The .en-ca stuff is for higher level conventions like language, regional dictionaries, currency symbols, number separators and so forth.
This will go in my notes for future reference if it happens again.
It is funny that the par2 program had no problem seeing the repair volume files with the glyph but couldn't see the rar files with the glyph.
Is it possible you handed par2 the names of the repair files on the command line, but that par2 was getting the rar filenames from the metadata?
Cheers, Cameron Simpson cs@zip.com.au
On 05/14/2016 07:25 PM, Robin Laing wrote:
Hello,
I am trying to run par2 to repair an archive that has an apostrophe in the name. Not a single quote. This archive was created on Windows.
File name should be Joe’s file.part01.rar
If I do ls I get Joe?s file.part01.rar
ls -b I get Joe\302\222s\ file.part01.rar
===>
as already replied, you may be having a problem with oos character set, so using "drag and paste" with mouse pointer may well work.
something that has not been mentioned is using "back slash", "".
to test with "", i created a file in konqueror, "test4'inname", pressed <F4> for a terminal and tried following;
~]$ ll test* -rw-rw-r--. 1 geo geo 2 May 14 23:36 test4'inname -rw-rw-r--. 1 geo geo 0 Aug 19 2015 test-addr.ldif -rw-rw-r--. 1 geo geo 2591 Aug 19 2015 test-fam.ldif ~]$ mv test4'inname testfourinname
^C
~]$ mv test4'inname testfourinname ~]$ ll test* -rw-rw-r--. 1 geo geo 0 Aug 19 2015 test-addr.ldif -rw-rw-r--. 1 geo geo 2591 Aug 19 2015 test-fam.ldif -rw-rw-r--. 1 geo geo 2 May 14 23:36 testfourinname ~]$
may be worth a try.
hth.