LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multibyte or wide character - Renaming all files (https://www.linuxquestions.org/questions/linux-newbie-8/multibyte-or-wide-character-renaming-all-files-4175487444/)

slaka 12-09-2013 09:05 PM

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'.

berndbausch 12-11-2013 12:04 AM

Quote:

Originally Posted by slaka (Post 5078220)
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.

DavidMcCann 12-11-2013 11:10 AM

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


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