cp does not like filenames with accents? | Unix Linux Forums | Slackware

  Go Back    


Slackware The Official Release of Slackware Linux by Patrick Volkerding is an advanced Linux operating system, designed with the twin goals of ease of use and stability as top priorities.

cp does not like filenames with accents?

Slackware


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-30-2012
stf92 stf92 is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 16 December 2014, 4:22 PM EST
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
cp does not like filenames with accents?

Hi:

Code:
mkisofs -graft-points -rational-rock -joliet -joliet-long -full-iso9660-filenames -iso-level 2 -o /tmp/image.iso  STORE1/=/almacen/strauss

In /almacen/strauss there are filenames containing not only spaces but accented characters as well. I burned the image to DVD, with the result that all spaces and accents were conserved. This seems to contradict use of the option -full-iso9660-filenames as well as -iso-level 2, and has an undesirable side effect, as will be seen.

I now copy the DVD to the hard disk, and if the current directory is in an NTFS partition, I get
Code:
$ cp -r /mnt/cd0/STORE1 . 
cp: cannot create regular file 'some_file_name': Invalid or incomplete multibyte or wide character.

for those filenames that contain an accent.

Any way to avoid this cp error?

Slackware 14.0
Sponsored Links
    #2  
Old 12-30-2012
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 20 December 2014, 8:52 PM EST
Location: NM
Posts: 10,313
Thanks: 297
Thanked 822 Times in 764 Posts
Is it imperative that the native charset remain in tact on the destination side?
If that is the case: Can you set the locale of the process doing the copy to match what is on the disc? If you do this every app you run against your will have to be set to use that special locale.

Otherwise use tar and iconv

Code:
mkdir /newdir
cd /mnt/cd0/STORE1
tar -c --file /dev/tty   |  ( cd /newdir ; | iconv [conversion options here] | tar xf )

[conversion options here] == you need to supply this.
Sponsored Links
    #3  
Old 12-30-2012
stf92 stf92 is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 16 December 2014, 4:22 PM EST
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
Thank you, jim.
Quote:
Is it imperative that the native charset remain in tact on the destination side?
Unluckily, it is. These files were created by downloading web pages from internet. If the foo_files get renamed, then all appearances of 'foo_files' in foo.html would have to be renamed too. It seems that the only way out is to be careful when downloading HTML files and change the name, in the Save As dialog box, if appropriate.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
remove accents and symbols with sed mierdatuti Shell Programming and Scripting 7 01-06-2009 06:10 PM
Patterns in Filenames msb65 Shell Programming and Scripting 6 08-01-2008 05:44 PM
prefixing filenames ravi raj kumar Shell Programming and Scripting 2 11-20-2007 06:17 AM
spaces in filenames Hitori Shell Programming and Scripting 4 07-04-2006 05:35 PM
Error When Print Accents edvaldo UNIX for Dummies Questions & Answers 0 07-31-2004 06:10 PM



All times are GMT -4. The time now is 11:17 PM.