[SOLVED] How to rename files with "Invalid or incomplete multibyte or wide character" in name?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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).
You're probably not using an UTF-8 locale both in pyRenamer and for your NTFS mount.
Check your locale settings with
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.