{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/121828291","pull_request_review_id":43885764,"id":121828291,"diff_hunk":"@@ -123,13 +127,158 @@ struct Converter {\n     }\n   }\n \n+  explicit Converter(UConverter* converter,\n+                     const char* sub = NULL) : conv(converter) {\n+    CHECK_NE(conv, nullptr);\n+    UErrorCode status = U_ZERO_ERROR;\n+    if (sub != NULL) {\n+      ucnv_setSubstChars(conv, sub, strlen(sub), &status);\n+    }\n+  }\n+\n   ~Converter() {\n     ucnv_close(conv);\n   }\n \n   UConverter* conv;\n };\n \n+class ConverterObject : public BaseObject, Converter {\n+ public:\n+  enum ConverterFlags {\n+    CONVERTER_FLAGS_FLUSH      = 0x1,\n+    CONVERTER_FLAGS_FATAL      = 0x2,\n+    CONVERTER_FLAGS_IGNORE_BOM = 0x4\n+  };\n+\n+  ~ConverterObject() override {}\n+\n+  static void Has(const FunctionCallbackInfo<Value>& args) {\n+    Environment* env = Environment::GetCurrent(args);\n+    HandleScope scope(env->isolate());\n+\n+    CHECK_GE(args.Length(), 1);\n+    Utf8Value label(env->isolate(), args[0]);\n+\n+    UErrorCode status = U_ZERO_ERROR;\n+    UConverter* conv = ucnv_open(*label, &status);\n+    args.GetReturnValue().Set(!!U_SUCCESS(status));\n+    ucnv_close(conv);\n+  }\n+\n+  static void Create(const FunctionCallbackInfo<Value>& args) {\n+    Environment* env = Environment::GetCurrent(args);\n+    HandleScope scope(env->isolate());\n+\n+    CHECK_GE(args.Length(), 2);\n+    Utf8Value label(env->isolate(), args[0]);\n+    int flags = args[1]->Uint32Value();\n+    bool fatal =\n+        (flags & CONVERTER_FLAGS_FATAL) == CONVERTER_FLAGS_FATAL;\n+    bool ignoreBOM =\n+        (flags & CONVERTER_FLAGS_IGNORE_BOM) == CONVERTER_FLAGS_IGNORE_BOM;\n+\n+    UErrorCode status = U_ZERO_ERROR;\n+    UConverter* conv = ucnv_open(*label, &status);\n+    if (U_FAILURE(status))\n+      return;\n+\n+    if (fatal) {\n+      status = U_ZERO_ERROR;\n+      ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_STOP,\n+                          nullptr, nullptr, nullptr, &status);\n+    }\n+\n+    Local<ObjectTemplate> t = ObjectTemplate::New(env->isolate());\n+    t->SetInternalFieldCount(1);\n+    Local<Object> obj = t->NewInstance(env->context()).ToLocalChecked();\n+    new ConverterObject(env, obj, conv, ignoreBOM);\n+    args.GetReturnValue().Set(obj);\n+  }\n+\n+  static void Decode(const FunctionCallbackInfo<Value>& args) {\n+    Environment* env = Environment::GetCurrent(args);\n+\n+    CHECK_GE(args.Length(), 3);  // Converter, ArrayBuffer, Flags","path":"src/node_i18n.cc","position":98,"original_position":98,"commit_id":"1e8402f57c5bf2f46a52a8edf2f11ae0b79ce004","original_commit_id":"1e8402f57c5bf2f46a52a8edf2f11ae0b79ce004","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars1.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"body":"s/ArrayBuffer/Buffer/","created_at":"2017-06-14T00:18:16Z","updated_at":"2017-06-14T00:47:26Z","html_url":"https://github.com/nodejs/node/pull/13644#discussion_r121828291","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/13644","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/121828291"},"html":{"href":"https://github.com/nodejs/node/pull/13644#discussion_r121828291"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/13644"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/13644","id":125270893,"html_url":"https://github.com/nodejs/node/pull/13644","diff_url":"https://github.com/nodejs/node/pull/13644.diff","patch_url":"https://github.com/nodejs/node/pull/13644.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/13644","number":13644,"state":"open","locked":false,"title":"buffer: implement WHATWG Encoding Standard API","user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars1.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"body":"Provide an (initially experimental) implementation of the WHATWG Encoding Standard API (`TextDecoder` and `TextEncoder`). The is the same API implemented on the browser side.\r\n\r\nBy default, with small-icu, only the UTF-8, UTF-16le and UTF-16be decoders are supported. With full-icu enabled, every encoding other than iso-8859-16 is supported.\r\n\r\nThis provides a basic test, but does not include the full web platform tests. Note: many of the web platform tests for this would fail by default because we ship with small-icu by default.\r\n\r\nThe implementation is added without changing any of the existing encoding support in core.\r\n\r\nRefs: https://encoding.spec.whatwg.org/\r\n\r\n/cc @domenic @TimothyGu @addaleax \r\n\r\n##### Checklist\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines)\r\n\r\n##### Affected core subsystem(s)\r\n\r\nbuffer","created_at":"2017-06-13T03:19:20Z","updated_at":"2017-06-14T00:47:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a598e953a84c194e19707427a6ba16bb6b2a5414","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/13644/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/13644/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/13644/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/1e8402f57c5bf2f46a52a8edf2f11ae0b79ce004","head":{"label":"jasnell:encoding-standard","ref":"encoding-standard","sha":"1e8402f57c5bf2f46a52a8edf2f11ae0b79ce004","user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars1.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"repo":{"id":37868459,"name":"node","full_name":"jasnell/node","owner":{"login":"jasnell","id":439929,"avatar_url":"https://avatars1.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasnell/node","description":"Future Node.js releases will be based on io.js","fork":true,"url":"https://api.github.com/repos/jasnell/node","forks_url":"https://api.github.com/repos/jasnell/node/forks","keys_url":"https://api.github.com/repos/jasnell/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasnell/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasnell/node/teams","hooks_url":"https://api.github.com/repos/jasnell/node/hooks","issue_events_url":"https://api.github.com/repos/jasnell/node/issues/events{/number}","events_url":"https://api.github.com/repos/jasnell/node/events","assignees_url":"https://api.github.com/repos/jasnell/node/assignees{/user}","branches_url":"https://api.github.com/repos/jasnell/node/branches{/branch}","tags_url":"https://api.github.com/repos/jasnell/node/tags","blobs_url":"https://api.github.com/repos/jasnell/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasnell/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasnell/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasnell/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasnell/node/statuses/{sha}","languages_url":"https://api.github.com/repos/jasnell/node/languages","stargazers_url":"https://api.github.com/repos/jasnell/node/stargazers","contributors_url":"https://api.github.com/repos/jasnell/node/contributors","subscribers_url":"https://api.github.com/repos/jasnell/node/subscribers","subscription_url":"https://api.github.com/repos/jasnell/node/subscription","commits_url":"https://api.github.com/repos/jasnell/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasnell/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasnell/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasnell/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasnell/node/contents/{+path}","compare_url":"https://api.github.com/repos/jasnell/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasnell/node/merges","archive_url":"https://api.github.com/repos/jasnell/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasnell/node/downloads","issues_url":"https://api.github.com/repos/jasnell/node/issues{/number}","pulls_url":"https://api.github.com/repos/jasnell/node/pulls{/number}","milestones_url":"https://api.github.com/repos/jasnell/node/milestones{/number}","notifications_url":"https://api.github.com/repos/jasnell/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasnell/node/labels{/name}","releases_url":"https://api.github.com/repos/jasnell/node/releases{/id}","deployments_url":"https://api.github.com/repos/jasnell/node/deployments","created_at":"2015-06-22T17:01:18Z","updated_at":"2017-05-25T13:39:43Z","pushed_at":"2017-06-13T20:27:06Z","git_url":"git://github.com/jasnell/node.git","ssh_url":"git@github.com:jasnell/node.git","clone_url":"https://github.com/jasnell/node.git","svn_url":"https://github.com/jasnell/node","homepage":"https://iojs.org","size":283495,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"c4fc7d90eddbdb23d814a38192e6979f8fc285a7","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars0.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars0.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2017-06-14T00:43:09Z","pushed_at":"2017-06-13T23:20:58Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":295093,"stargazers_count":36038,"watchers_count":36038,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6953,"mirror_url":null,"open_issues_count":983,"forks":6953,"open_issues":983,"watchers":36038,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/13644"},"html":{"href":"https://github.com/nodejs/node/pull/13644"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/13644"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/13644/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/13644/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/13644/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/1e8402f57c5bf2f46a52a8edf2f11ae0b79ce004"}}}}
{"actor":{"display_login":"TimothyGu"}}