0

I installed and configured a QNAP TS-463U-RP in a branch office to mirror data used by this office and the main office.

Some time after the initial sync, I suddenly find special (maybe Unicode) characters in file- and directory names. Windows command line with the default codepage depicts them as a ?, changing the codepage to e.g. 1252 shows the characters to be . Connecting via SSH shows them as ".

Now I can rename the files using SSH or the Windows command line (not using explorer, though), but this is tedious. I tried searching the directory structure using different tools (find, Windows Search, some 3rd party tools etc.) but couldn't come up with any pattern to automate the process.

My backup is up to date, except for the special-char-files which seem to be added at random, these I have to repair...

I don't even really know what characters these are.

I do know that they are using Macs on NTFS, maybe it has something to do with it.

So: How could I proceed in renaming the files automatically and - even more important - how could I prevent the files from being renamed / created?

Lenniey
  • 5,090
  • 2
  • 17
  • 28

1 Answers1

0

After some time tinkering with Unicode and Powershell I came across the module Get-Unicodeinfo. This module showed me that the filenames were created with the special Unicode character F020.

So I wrote a oneline-script in Powershell: gci -recurse -Path Z:\ -Exclude Z:\Temp | where {$_.Name -match "[\uF022]"} | rename-item -newname {$_.name -replace "[\uF022]",""} to replace the Unicode characters with an empty string.

So far, so good, but I still don't know where the filenames came from. But till now, no new faulty files have been added. I presume, that some conversion from/to Mac/HFS+/NTFS/... played a part.

Lenniey
  • 5,090
  • 2
  • 17
  • 28