Problem in PscxCmdlet.IPscxFileHandler.cs

Topics: Developer Forum
Feb 19, 2007 at 6:51 PM
Edited Feb 19, 2007 at 6:59 PM
I noticed that my Format-Xml cmdlet was choking when it was passed a path to some XML encoded as unicode. I tracked the problem down to here:

void IPscxFileHandler.ProcessText(string path, Action<StreamReader> action)
    FileHandler.ProcessText(path, false, action);
The second parameter to ProcessText disables encoding detection. I updated the XmlCommandBase to use the other ProcesText overload so I could request encoding detection. That fixed the problem. Still I wonder if 'false' is the correct default for the method above especially considering PoSH wants to write to files using Unicode. Thoughts?
Feb 19, 2007 at 10:35 PM
You're right, fixed that.