invalid characters in filenames

When I switched to openSuse from PCLinuxOS I had a ton of music files from my collection. Some of the file and/or folder names had special characters like apostrophe or macron in them. openSuse won’t allow me to play, copy/move or delete (I’d prefer to keep them) these files or folders. I discovered if the filename is one word (no spaces), I can rename it at the cli. But this fails if there is a space (single or double quotes don’t help). Here’s what I know:

In konq or dolphin: The problem character is displayed as a black diamond with a question mark in it. When I attempt renaming or copy/move, the error message says file not found and replaces the diamond with “�”.

At the cli: “ls” lists the filename with a question mark as replacement for the special character. If I do “ls | cat -v” the special character is replaced by “M-a” or “M-i” (I suppose different special characters).

Is there a way to fix these file names? I have not yet attempted booting to PCLinuxOS livecd to see if I can access them that way.

I am using openSuse 11.1 (all updates) KDE 4.2 and reisferfs file system.

Have you tried renaming the files? Use a wild card to get round the special characters,

mv xxxyyy.txt newfilename.txt*

Sweet simplicity… works like a charm. Thanks

If putting quotes round something with a space in doesn’t work, it might be worth trying to use \ as an escape character. Maybe this does exactly the same thing as quotes, but maybe there are situations where one works and not the other. Anyone know for sure?


echo test > "dont put spaces in filenames"
mv dont\ put\ spaces\ in\ filenames thats.better

I have a similar problem, but with files created INSIDE dolphin. I create a file with name such as poznań, then Dolphin decides it is an invalid file and claims it doesn’t exist. I cannot rename it or delete it. My trash bin is full of a few that Dolphin let me trash, but now won’t let me delete, because it thinks they are not there. The Polish letters were replaced with graphic symbols. Many files in my home directory are untouchables as well after creation. I have tried playing with the encoding in the Dolphin system settings. It is only for show. It does not alter the accessibility to those files that Dolphin switched from the Polish to graphic symbols.

What can I do?

They should generally do the same thing, but try inserting escape characters in something like “$FILENAME.”

Sounds like a bug in Dolphin. Why don’t you report it?

https://bugzilla.novell.com/index.cgi

The original problem with filename encoding can probably be solved with “convmv” command. See “man convmv”. You can test what encoding was by for instance “ls * | recode ISO-8859-1…” if you have reasons to suspect that original encoding was ISO-8859-1.

I agree; I have several files with Czech accents in the filenames, e.g. Šárka.ogg, but I have Konqueror as my file manager, as I did in KDE3.5, and I have never had any problems.

I downloaded some tar.gz’s from a Russian literary site. I unpacked them. Then I renamed the files, and moved them. I trashed the folders, which had the same names as the files. These folders were in my trash. Emptying trash would not get rid of them. Going to the .local and deleting wouldn’t work. The report was that the folders did not exist. That was only one example. Others of similar strangeness were just sitting in my folders. I had created them in OpenSuSE 11.0 or even 10.3 with Konq in KDE3. Now they are illegible, unrenamable, unmovable, and undeletable (even from within root). This is what is all so unbelievable!

Did any of you check the LOCALE settings in the /etc/sysconfig editor? And if so, did you check the Regional Settings in Systemsettings? As you can see I’m in the Netherlands, I can use any character to create files and folders, rename them, trash them, and clear them from trash. And all this in Dolphin, in Konqueror, in Krusader. As well on my main machine as on my laptop as on the other systems in my home.

I normally can too. Maybe 10% of the time there will be a problem. I’ve tried mapping to troubleshoot, but it usually happens when I have no time. sigh

The real problem is the huge mystery… why do such normal operations break within such a critical program? Can’t the programmers be more careful? Can’t they follow protocol and actually run some tests on the code? It is not the only thing broken since KDE4.

openSUSE 12.2 - It’s still a big pain in the ass if somehow you have invalid file names:

  1. you can’t rename it using Dolphin
  2. you can’t shift-delete it using Dolphin
  3. you can’t delete it from command line
  4. you can move it to Trash. later, you can’t empty the Trash:

http://img-fotki.yandex.ru/get/6415/73339514.24/0_7a435_9104fba8_orig

Filed bug report: https://bugzilla.novell.com/show_bug.cgi?id=787679

On Thu 01 Nov 2012 11:56:01 AM CDT, tosiara wrote:

openSUSE 12.2 - It’s still a big pain in the ass if somehow you have
invalid file names:

  1. you can’t rename it using Dolphin
  2. you can’t shift-delete it using Dolphin
  3. you can’t delete it from command line
  4. you can move it to Trash. later, you can’t empty the Trash:

[image:
http://img-fotki.yandex.ru/get/6415/73339514.24/0_7a435_9104fba8_orig]

Hi
From the command line have you tried adding a leading \ to each of the
characters to delete?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 3 days 12:58, 4 users, load average: 0.14, 0.06, 0.06
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

tosiara wrote:
> openSUSE 12.2 - It’s still a big pain in the ass if somehow you have
> invalid file names:
>
> 1. you can’t rename it using Dolphin
> 2. you can’t shift-delete it using Dolphin

I don’t know anything about Dolphin, so that might be true.

> 3. you can’t delete it from command line

I do know about command line and that isn’t true. There are various
tricks for removing files with funny filenames. Most use shell patterns
to select the file. Another, failsafe, technique is to move all the
files you want to keep out of the directory and then rm -r the directory.

> 4. you can move it to Trash. later, you can’t empty the Trash:

See #3

Which character should I escape? Is it “?” or “�”?
If the file is the only one in the dir - I can use Tab to fill file name. Otherwise - I need to type file name. How can I type “???..” file name?

$ ls
??? ???饭?? ???ᥪ? ?? ??? ?.?. ?०??? (1971).mp4

$ cp hit_TAB ����������\ ����饭��\ ���ᥪ�\ ��\ ����\ �.�.\ �०����\ (1971).mp4

Some users are not so experienced. All they see - is that they can no longer empty trash

On 2012-11-01 12:56, tosiara wrote:
>
> openSUSE 12.2 - It’s still a big pain in the ass if somehow you have
> invalid file names:

> 3. you can’t delete it from command line

Of course you can. Prove here that you can not. Inside code tags, please.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

Hi
You could also delete via inode.

What’s the output for the file from;


ls –il