LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-09-2013, 10:05 PM   #1
slaka
Member
 
Registered: Oct 2012
Distribution: Slackware 14.0 86x
Posts: 43

Rep: Reputation: Disabled
Multibyte or wide character - Renaming all files


Hey,
Error which have caused big problems for me 'Invalid or incomplete multibyte or wide character' when moving/copying files is appearing again.

Scenario is where I move files from ext2 to ntfs. Locale settings are set to en_US-UTF8, also in fstab ntfs-3g is mounted with appropriate en_US.UTF-8 locale option -- error still appearing.

Thing what I want to do is to remove these characters completely from filenames.
So I'm looking for best way to do this. I want simply rename 'filename*something' to 'filenamebsomething' where '*' repesents multibyte character. Want to preserve filenames and everything else but just change '*' to 'b'.
 
Old 12-11-2013, 01:04 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,688

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by slaka View Post
I want simply rename 'filename*something' to 'filenamebsomething' where '*' repesents multibyte character. Want to preserve filenames and everything else but just change '*' to 'b'.
What locale do those multibyte characters belong to? Perhaps you can set your LANG and/or LC_<...> variables to this locale and use sed to remove the offending characters.
 
Old 12-11-2013, 12:10 PM   #3
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,264

Rep: Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246
You could write a script to work its way through a directory checking and altering files with undesirable names, but it would need more knowledge of bash than I have. This sort of thing:
http://stackoverflow.com/questions/2...files-in-linux
http://www.thingy-ma-jig.co.uk/blog/...h-rename-files
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ntfs-3g and invalid or incomplete multibyte or wide character porphyry5 Slackware 2 10-28-2013 04:16 PM
[SOLVED] How to rename files with "Invalid or incomplete multibyte or wide character" in name? okok Linux - General 2 09-25-2012 06:59 AM
[SOLVED] Invalid or incomplete multibyte or wide character ?? mgai7755 Linux - Newbie 6 05-16-2011 10:39 AM
Samba/Kerberos : ads_connect: Invalid or incomplete multibyte or wide character Lordandmaker Linux - Networking 0 04-01-2008 06:03 AM
Invalid or incomplete multibyte or wide character chanys Linux - General 1 03-13-2003 11:09 PM


All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration