LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to rename files with "Invalid or incomplete multibyte or wide character" in name? (https://www.linuxquestions.org/questions/linux-general-1/how-to-rename-files-with-invalid-or-incomplete-multibyte-or-wide-character-in-name-4175428922/)

okok 09-25-2012 04:07 AM

How to rename files with "Invalid or incomplete multibyte or wide character" in name?
 
I have a large number of files whose names contain all sorts of accents: ü,è etc. In most applications I can use them without problem, but when I was trying to copy them to an NTFS drive, I got messages such as

Error opening file: 'filename_with_ä_or_ü_.txt' Invalid or incomplete multibyte or wide character.

When I remove those accented charcters from the filenames the problem is sovled. However, I have a very large number of those files, and the obvious solution (since I am not knowledgeable enough in command-line operations), to use a tool such as pyRenamer and replace those characters with accent-less characters fails. In pyRenamer's internal display those characters are displayed as something like [x]. I tried also simple command-line renaming commands, but could not get the desired result.

I'd appreciate both explanations on why I get this problem, and how to fix it (either by preserving the current names, with the accents, or by replacing them).

414N 09-25-2012 04:21 AM

You're probably not using an UTF-8 locale both in pyRenamer and for your NTFS mount.
Check your locale settings with
Code:

locale
You can force a locale when mounting NTFS filesystem with ntfs-3g using the mount option locale=LOCALE (i.e. locale=en_US.utf8), although that's not a recommended option as you should use the same locale you're using on your system. Read this thread for some relevant info.

okok 09-25-2012 05:59 AM

Thanks. The Debian UTF-8 Migration tool turned out to be a simple and complete solution to this problem. It changed my locale to UTF-8 and made the necessary changes to file names.


All times are GMT -5. The time now is 10:26 AM.