PowerShell-Beautifier
PowerShell-Beautifier copied to clipboard
Rewrite file encoding detection for efficiency and UTF-32 support
The function for determining the file encoding (Get-DTWFileEncoding) - specifically the code if no BOM is present - is not as efficient as it could be. Also, it might also have an subtle bug (if a 3 byte character exists at the beginning of a UTF-16 file). And it doesn't handle UTF-32 files. Update Get-DTWFileEncoding to fixed these issues.
Also, add UTF-32 files to test/FileEncoding tests.
Seriously, though, does anyone actually store their code in UTF-32?