{"action":"created","comment":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/129398544","pull_request_review_id":52167567,"id":129398544,"diff_hunk":"@@ -0,0 +1,399 @@\n+/********************************************************************++\n+Copyright (c) Microsoft Corporation.  All rights reserved.\n+--********************************************************************/\n+\n+using System;\n+using System.Collections.Generic;\n+using System.Globalization;\n+using System.IO;\n+using System.Text;\n+using System.Management.Automation;\n+using System.Management.Automation.Provider;\n+\n+namespace Microsoft.PowerShell\n+{\n+    /// <summary>\n+    /// The list of available file encodings\n+    /// </summary>\n+    public enum FileEncoding\n+    {\n+        /// <summary>\n+        /// No encoding, or unset.\n+        /// </summary>\n+        Unknown,\n+\n+        /// <summary>\n+        /// Unicode encoding.\n+        /// </summary>\n+        String,\n+\n+        /// <summary>\n+        /// Unicode encoding.\n+        /// </summary>\n+        Unicode,\n+\n+        /// <summary>\n+        /// Byte encoding.\n+        /// </summary>\n+        Byte,\n+\n+        /// <summary>\n+        /// Big Endian Unicode encoding.\n+        /// </summary>\n+        BigEndianUnicode,\n+\n+        /// <summary>\n+        /// Backward compatibility - UTF8 encoding without BOM\n+        /// </summary>\n+        UTF8,\n+\n+        /// <summary>\n+        /// UTF8 encoding which includes BOM.\n+        /// </summary>\n+        UTF8BOM,\n+\n+        /// <summary>\n+        /// UTF8 encoding without BOM.\n+        /// </summary>\n+        UTF8NoBOM,\n+\n+        /// <summary>\n+        /// UTF7 encoding.\n+        /// </summary>\n+        UTF7,\n+\n+        /// <summary>\n+        /// UTF32 encoding.\n+        /// </summary>\n+        UTF32,\n+\n+        /// <summary>\n+        /// ASCII encoding.\n+        /// </summary>\n+        Ascii,\n+\n+        /// <summary>\n+        /// Default encoding.\n+        /// </summary>\n+        Default,\n+\n+        /// <summary>\n+        /// OEM encoding.\n+        /// </summary>\n+        Oem,\n+\n+        /// <summary>\n+        /// Big Endian UTF32 encoding\n+        /// </summary>\n+        BigEndianUTF32,\n+\n+        /// <summary>\n+        /// Windows legacy encoding. This requires a cmdlet object to resolve.\n+        /// </summary>\n+        WindowsLegacy,\n+    }\n+\n+    /// <summary>\n+    /// the helper class for determining encodings for PowerShell\n+    /// </summary>\n+    public static class PowerShellEncoding\n+    {\n+\n+        /// <summary>\n+        /// Return the default PowerShell encoding which is UTF8 without a BOM.\n+        /// There is no distinction between platforms\n+        /// </summary>\n+        public static Encoding GetDefaultEncoding()\n+        {\n+            return utf8NoBom;\n+        }\n+\n+        /// <summary>\n+        /// translate a FileEncoding to an actual System.Text.Encoding\n+        /// <param name=\"TextEncoding\">The enum value</param>\n+        /// <returns>System.Text.Encoding</returns>\n+        /// </summary>\n+        public static Encoding GetEncoding(FileEncoding TextEncoding)","path":"src/System.Management.Automation/utils/Encoding.cs","position":116,"original_position":116,"commit_id":"f9c640010facf400fe2922314a11b8c2811e1090","original_commit_id":"f9c640010facf400fe2922314a11b8c2811e1090","user":{"login":"JamesWTruher","id":10214008,"avatar_url":"https://avatars2.githubusercontent.com/u/10214008?v=4","gravatar_id":"","url":"https://api.github.com/users/JamesWTruher","html_url":"https://github.com/JamesWTruher","followers_url":"https://api.github.com/users/JamesWTruher/followers","following_url":"https://api.github.com/users/JamesWTruher/following{/other_user}","gists_url":"https://api.github.com/users/JamesWTruher/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesWTruher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesWTruher/subscriptions","organizations_url":"https://api.github.com/users/JamesWTruher/orgs","repos_url":"https://api.github.com/users/JamesWTruher/repos","events_url":"https://api.github.com/users/JamesWTruher/events{/privacy}","received_events_url":"https://api.github.com/users/JamesWTruher/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2017-07-25T19:12:22Z","updated_at":"2017-07-25T19:12:22Z","html_url":"https://github.com/PowerShell/PowerShell/pull/4119#discussion_r129398544","pull_request_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119","_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments/129398544"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/4119#discussion_r129398544"},"pull_request":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119"}}},"pull_request":{"url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119","id":127758377,"html_url":"https://github.com/PowerShell/PowerShell/pull/4119","diff_url":"https://github.com/PowerShell/PowerShell/pull/4119.diff","patch_url":"https://github.com/PowerShell/PowerShell/pull/4119.patch","issue_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/4119","number":4119,"state":"open","locked":false,"title":"Unify file encoding when a cmdlet creates a file","user":{"login":"JamesWTruher","id":10214008,"avatar_url":"https://avatars2.githubusercontent.com/u/10214008?v=4","gravatar_id":"","url":"https://api.github.com/users/JamesWTruher","html_url":"https://github.com/JamesWTruher","followers_url":"https://api.github.com/users/JamesWTruher/followers","following_url":"https://api.github.com/users/JamesWTruher/following{/other_user}","gists_url":"https://api.github.com/users/JamesWTruher/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesWTruher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesWTruher/subscriptions","organizations_url":"https://api.github.com/users/JamesWTruher/orgs","repos_url":"https://api.github.com/users/JamesWTruher/repos","events_url":"https://api.github.com/users/JamesWTruher/events{/privacy}","received_events_url":"https://api.github.com/users/JamesWTruher/received_events","type":"User","site_admin":false},"body":"Implementation of https://github.com/PowerShell/PowerShell-RFC/blob/master/1-Draft/RFC0020-DefaultFileEncoding.md\r\n\r\nCmdlets now create files with consistent encoding (UTF8 without BOM) on all platforms.\r\nA new preference variable `PSDefaultFileEncoding` is now available to enable users to set encoding for cmdlets. By setting `$PSDefaultFileEncoding = \"WindowsLegacy\"` users can select the encoding which exists in PowerShell5 for each specific cmdlet.\r\n\r\nProvider and cmdlet encoding methods have been centralized and are now common.\r\n","created_at":"2017-06-27T18:11:44Z","updated_at":"2017-07-25T19:12:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"08e15785ca8ebf7908b612cf1dd9e6ca0afd5a02","assignee":{"login":"lzybkr","id":2148248,"avatar_url":"https://avatars3.githubusercontent.com/u/2148248?v=4","gravatar_id":"","url":"https://api.github.com/users/lzybkr","html_url":"https://github.com/lzybkr","followers_url":"https://api.github.com/users/lzybkr/followers","following_url":"https://api.github.com/users/lzybkr/following{/other_user}","gists_url":"https://api.github.com/users/lzybkr/gists{/gist_id}","starred_url":"https://api.github.com/users/lzybkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzybkr/subscriptions","organizations_url":"https://api.github.com/users/lzybkr/orgs","repos_url":"https://api.github.com/users/lzybkr/repos","events_url":"https://api.github.com/users/lzybkr/events{/privacy}","received_events_url":"https://api.github.com/users/lzybkr/received_events","type":"User","site_admin":false},"assignees":[{"login":"lzybkr","id":2148248,"avatar_url":"https://avatars3.githubusercontent.com/u/2148248?v=4","gravatar_id":"","url":"https://api.github.com/users/lzybkr","html_url":"https://github.com/lzybkr","followers_url":"https://api.github.com/users/lzybkr/followers","following_url":"https://api.github.com/users/lzybkr/following{/other_user}","gists_url":"https://api.github.com/users/lzybkr/gists{/gist_id}","starred_url":"https://api.github.com/users/lzybkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzybkr/subscriptions","organizations_url":"https://api.github.com/users/lzybkr/orgs","repos_url":"https://api.github.com/users/lzybkr/repos","events_url":"https://api.github.com/users/lzybkr/events{/privacy}","received_events_url":"https://api.github.com/users/lzybkr/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119/commits","review_comments_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119/comments","review_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/4119/comments","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/f9c640010facf400fe2922314a11b8c2811e1090","head":{"label":"JamesWTruher:jameswtruher/encoding3","ref":"jameswtruher/encoding3","sha":"f9c640010facf400fe2922314a11b8c2811e1090","user":{"login":"JamesWTruher","id":10214008,"avatar_url":"https://avatars2.githubusercontent.com/u/10214008?v=4","gravatar_id":"","url":"https://api.github.com/users/JamesWTruher","html_url":"https://github.com/JamesWTruher","followers_url":"https://api.github.com/users/JamesWTruher/followers","following_url":"https://api.github.com/users/JamesWTruher/following{/other_user}","gists_url":"https://api.github.com/users/JamesWTruher/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesWTruher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesWTruher/subscriptions","organizations_url":"https://api.github.com/users/JamesWTruher/orgs","repos_url":"https://api.github.com/users/JamesWTruher/repos","events_url":"https://api.github.com/users/JamesWTruher/events{/privacy}","received_events_url":"https://api.github.com/users/JamesWTruher/received_events","type":"User","site_admin":false},"repo":{"id":66010077,"name":"PowerShell-1","full_name":"JamesWTruher/PowerShell-1","owner":{"login":"JamesWTruher","id":10214008,"avatar_url":"https://avatars2.githubusercontent.com/u/10214008?v=4","gravatar_id":"","url":"https://api.github.com/users/JamesWTruher","html_url":"https://github.com/JamesWTruher","followers_url":"https://api.github.com/users/JamesWTruher/followers","following_url":"https://api.github.com/users/JamesWTruher/following{/other_user}","gists_url":"https://api.github.com/users/JamesWTruher/gists{/gist_id}","starred_url":"https://api.github.com/users/JamesWTruher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JamesWTruher/subscriptions","organizations_url":"https://api.github.com/users/JamesWTruher/orgs","repos_url":"https://api.github.com/users/JamesWTruher/repos","events_url":"https://api.github.com/users/JamesWTruher/events{/privacy}","received_events_url":"https://api.github.com/users/JamesWTruher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JamesWTruher/PowerShell-1","description":"PowerShell for every system","fork":true,"url":"https://api.github.com/repos/JamesWTruher/PowerShell-1","forks_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/forks","keys_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/teams","hooks_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/hooks","issue_events_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/issues/events{/number}","events_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/events","assignees_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/assignees{/user}","branches_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/branches{/branch}","tags_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/tags","blobs_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/statuses/{sha}","languages_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/languages","stargazers_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/stargazers","contributors_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/contributors","subscribers_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/subscribers","subscription_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/subscription","commits_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/contents/{+path}","compare_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/merges","archive_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/downloads","issues_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/issues{/number}","pulls_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/pulls{/number}","milestones_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/milestones{/number}","notifications_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/labels{/name}","releases_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/releases{/id}","deployments_url":"https://api.github.com/repos/JamesWTruher/PowerShell-1/deployments","created_at":"2016-08-18T15:46:34Z","updated_at":"2017-06-19T22:59:25Z","pushed_at":"2017-07-22T04:18:07Z","git_url":"git://github.com/JamesWTruher/PowerShell-1.git","ssh_url":"git@github.com:JamesWTruher/PowerShell-1.git","clone_url":"https://github.com/JamesWTruher/PowerShell-1.git","svn_url":"https://github.com/JamesWTruher/PowerShell-1","homepage":"","size":27857,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"PowerShell:master","ref":"master","sha":"9571f8f2f438d27499f83effc252baf85211d8a6","user":{"login":"PowerShell","id":11524380,"avatar_url":"https://avatars3.githubusercontent.com/u/11524380?v=4","gravatar_id":"","url":"https://api.github.com/users/PowerShell","html_url":"https://github.com/PowerShell","followers_url":"https://api.github.com/users/PowerShell/followers","following_url":"https://api.github.com/users/PowerShell/following{/other_user}","gists_url":"https://api.github.com/users/PowerShell/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerShell/subscriptions","organizations_url":"https://api.github.com/users/PowerShell/orgs","repos_url":"https://api.github.com/users/PowerShell/repos","events_url":"https://api.github.com/users/PowerShell/events{/privacy}","received_events_url":"https://api.github.com/users/PowerShell/received_events","type":"Organization","site_admin":false},"repo":{"id":49609581,"name":"PowerShell","full_name":"PowerShell/PowerShell","owner":{"login":"PowerShell","id":11524380,"avatar_url":"https://avatars3.githubusercontent.com/u/11524380?v=4","gravatar_id":"","url":"https://api.github.com/users/PowerShell","html_url":"https://github.com/PowerShell","followers_url":"https://api.github.com/users/PowerShell/followers","following_url":"https://api.github.com/users/PowerShell/following{/other_user}","gists_url":"https://api.github.com/users/PowerShell/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerShell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerShell/subscriptions","organizations_url":"https://api.github.com/users/PowerShell/orgs","repos_url":"https://api.github.com/users/PowerShell/repos","events_url":"https://api.github.com/users/PowerShell/events{/privacy}","received_events_url":"https://api.github.com/users/PowerShell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PowerShell/PowerShell","description":"PowerShell for every system!","fork":false,"url":"https://api.github.com/repos/PowerShell/PowerShell","forks_url":"https://api.github.com/repos/PowerShell/PowerShell/forks","keys_url":"https://api.github.com/repos/PowerShell/PowerShell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PowerShell/PowerShell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PowerShell/PowerShell/teams","hooks_url":"https://api.github.com/repos/PowerShell/PowerShell/hooks","issue_events_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/events{/number}","events_url":"https://api.github.com/repos/PowerShell/PowerShell/events","assignees_url":"https://api.github.com/repos/PowerShell/PowerShell/assignees{/user}","branches_url":"https://api.github.com/repos/PowerShell/PowerShell/branches{/branch}","tags_url":"https://api.github.com/repos/PowerShell/PowerShell/tags","blobs_url":"https://api.github.com/repos/PowerShell/PowerShell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PowerShell/PowerShell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PowerShell/PowerShell/git/refs{/sha}","trees_url":"https://api.github.com/repos/PowerShell/PowerShell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PowerShell/PowerShell/statuses/{sha}","languages_url":"https://api.github.com/repos/PowerShell/PowerShell/languages","stargazers_url":"https://api.github.com/repos/PowerShell/PowerShell/stargazers","contributors_url":"https://api.github.com/repos/PowerShell/PowerShell/contributors","subscribers_url":"https://api.github.com/repos/PowerShell/PowerShell/subscribers","subscription_url":"https://api.github.com/repos/PowerShell/PowerShell/subscription","commits_url":"https://api.github.com/repos/PowerShell/PowerShell/commits{/sha}","git_commits_url":"https://api.github.com/repos/PowerShell/PowerShell/git/commits{/sha}","comments_url":"https://api.github.com/repos/PowerShell/PowerShell/comments{/number}","issue_comment_url":"https://api.github.com/repos/PowerShell/PowerShell/issues/comments{/number}","contents_url":"https://api.github.com/repos/PowerShell/PowerShell/contents/{+path}","compare_url":"https://api.github.com/repos/PowerShell/PowerShell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PowerShell/PowerShell/merges","archive_url":"https://api.github.com/repos/PowerShell/PowerShell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PowerShell/PowerShell/downloads","issues_url":"https://api.github.com/repos/PowerShell/PowerShell/issues{/number}","pulls_url":"https://api.github.com/repos/PowerShell/PowerShell/pulls{/number}","milestones_url":"https://api.github.com/repos/PowerShell/PowerShell/milestones{/number}","notifications_url":"https://api.github.com/repos/PowerShell/PowerShell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PowerShell/PowerShell/labels{/name}","releases_url":"https://api.github.com/repos/PowerShell/PowerShell/releases{/id}","deployments_url":"https://api.github.com/repos/PowerShell/PowerShell/deployments","created_at":"2016-01-13T23:41:35Z","updated_at":"2017-07-25T16:24:53Z","pushed_at":"2017-07-25T18:21:01Z","git_url":"git://github.com/PowerShell/PowerShell.git","ssh_url":"git@github.com:PowerShell/PowerShell.git","clone_url":"https://github.com/PowerShell/PowerShell.git","svn_url":"https://github.com/PowerShell/PowerShell","homepage":"https://microsoft.com/powershell","size":27512,"stargazers_count":7429,"watchers_count":7429,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1017,"mirror_url":null,"open_issues_count":945,"forks":1017,"open_issues":945,"watchers":7429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119"},"html":{"href":"https://github.com/PowerShell/PowerShell/pull/4119"},"issue":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/4119"},"comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/issues/4119/comments"},"review_comments":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119/comments"},"review_comment":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PowerShell/PowerShell/pulls/4119/commits"},"statuses":{"href":"https://api.github.com/repos/PowerShell/PowerShell/statuses/f9c640010facf400fe2922314a11b8c2811e1090"}}}}
{"actor":{"display_login":"JamesWTruher"}}