Add ability to specify whether UTF8 files have a BOM or not #56
Labels
enhancement
The issue is an enhancement request.
help wanted
The issue is up for grabs for anyone in the community.
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
andReplaceText
, not theIniSettingsFile
. This is because it does not have anEncoding
parameter.The text was updated successfully, but these errors were encountered: