-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Description
There are two types of UTF-8 text files, those with BOM and those without, and both are correct UTF-8.
Unfortunately, on some systems, the presence or absence of the BOM can have a serious impact on the behavior, so it must be handled strictly.
There is no way to specify this in the current implementation of FileContentDsc, and even worse, it behaves differently depending on the PowerShell version running the resource.
(In v5.1 and earlier, the BOM is attached, but in v6 and later, it is not.)
Proposed properties
I suggest adding "UTF8BOM" and "UTF8NoBOM" to the acceptable values for Encoding
parameter.
Special considerations or limitations
It would be better not to change the existing "UTF8" behavior to avoid serious breaking changes.
This change will only affects the KeyValuePairFile
and ReplaceText
, not the IniSettingsFile
. This is because it does not have an Encoding
parameter.