-
Notifications
You must be signed in to change notification settings - Fork 395
Help files should be UTF-8 encoded #251
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
Comments
Good idea! I'd like to see this check ps1, psm1, psd1, and ps1xml file encodings as well, warning on any files that are not UTF-8 encoded. |
Thanks @juneb and @KirkMunro for the suggestions! We will consider adding the rule to verify the encoding. |
Does it have to be UTF-8 with BOM? There are still lots of tools out that that don't handle BOM well. |
@KirkMunro You do realize that the PSD1 file generated by New-ModuleManifest is Unicode and not UTF-8? So I don't think it would be such a good idea to require UTF-8 for these files. In general, PowerShell creates Unicode files and not UTF-8 files. WRT to text files, ASCII files are valid UTF-8 files sans BOM as long as they stick to the range 0x00 - 0x7F. |
@rkeithhill: That's odd, and no, I hadn't realized that. ISE saves using UTF-8 by default, as did PowerGUI, and PowerSE. Why would New-ModuleManifest create a UTF-16 file then? I know there were some issues with which encoding was being used in the past, wrt to the editor that was used -- IIRC ISE couldn't open files with certain encodings. At any rate, you're right, for most cmdlets, the default value for -Encoding is Unicode (UTF-16). There isn't enough consensus here to form a rule for PowerShell files though. Maybe for XML files, since XML's encoding should match the encoding identified inside at the top of the xml file. |
My recommendation applied only to help files, which are expected to be UTF-8, not to other file types. |
The new rule is implemented with #288 |
Can we test help files in the modules, both XML and TXT, to assure that the encoding is UTF-8? There should be an error if it has any other encoding.
The text was updated successfully, but these errors were encountered: