Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify whether UTF8 files have a BOM or not #56

Open
mkht opened this issue Jan 16, 2021 · 0 comments · May be fixed by #59
Open

Add ability to specify whether UTF8 files have a BOM or not #56

mkht opened this issue Jan 16, 2021 · 0 comments · May be fixed by #59
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@mkht
Copy link

mkht commented Jan 16, 2021

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.

@PlagueHO PlagueHO added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants