Search code examples
xmlwindowspowershellunicodentfs

Why is a windows filename reporting it's name with unicode non-characters ()?


I have encountered a file that reports it's filename as 풜〣

This then fails to be interpreted as XML by SQL Server, as it is called out as a specifically invalid character in both XML v1.0 and v1.1.

When I dir the directory in cmd, I get ???? as the filename, which does seem to be four characters.

How I got any filename out of it at all was by PowerShell's Get-ChildItem.

Is there something else going on here? How could a Unicode Non-Character like '￿' (&#xFFFF) get into a filename, or is this somehow related to not installed language packs or something?


Solution

  • Thanks to @eryksun's comments, I was able to use the /U unicode switch in cmd to work with filenames with &#xFFFF.