Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Encoding for New-ModuleManifest on all platforms should be UTF-8 NoBOM#5923

Merged
adityapatwardhan merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:new-manifest-utf8SteveL-MSFT/PowerShell:new-manifest-utf8Copy head branch name to clipboard
Jan 18, 2018
Merged

Encoding for New-ModuleManifest on all platforms should be UTF-8 NoBOM#5923
adityapatwardhan merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:new-manifest-utf8SteveL-MSFT/PowerShell:new-manifest-utf8Copy head branch name to clipboard

Conversation

@SteveL-MSFT

@SteveL-MSFT SteveL-MSFT commented Jan 17, 2018

Copy link
Copy Markdown
Member

PR Summary

When we decided not to take #4119 it meant that the file encoding for New-ModuleManifest on Windows stayed as UTF-16 w/ BOM.
We had decided to adopt UTF-8 NoBOM as standard in PSCore6.
The fix is to remove Windows specific logic in the code and in the test for UTF-16 w/ BOM.

PR Checklist

Note: Please mark anything not applicable to this PR NA.

this,
filePath,
#if UNIX
new UTF8Encoding(false), // UTF-8, no BOM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer using named parameter instead of a comment about no BOM.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update

{
$ExpectedManifestBytes = @(35,10)
}
$ExpectedManifestBytes = @(35,10)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In BeforeEach, New-Item should pipe to $null. GitHub won't let me comment on that line since it is not near the change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add

false
cmdlet : this,
filePath : filePath,
resolvedEncoding : new UTF8Encoding(false), // UTF-8, no BOM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update, missed that one

@adityapatwardhan adityapatwardhan merged commit 7437f3d into PowerShell:master Jan 18, 2018
@SteveL-MSFT SteveL-MSFT deleted the new-manifest-utf8 branch January 31, 2018 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.