{"action":"created","comment":{"url":"https://api.github.com/repos/google/protobuf/pulls/comments/35501919","id":35501919,"diff_hunk":"@@ -188,8 +188,25 @@ bool TryCreateParentDirectory(const string& prefix, const string& filename) {\n // Get the absolute path of this protoc binary.\n bool GetProtocAbsolutePath(string* path) {\n #ifdef _WIN32\n-  char buffer[MAX_PATH];\n-  int len = GetModuleFileName(NULL, buffer, MAX_PATH);\n+  wchar_t wide_buffer[MAX_PATH];\n+  // Note: the returned length does not include terminating null character.\n+  int len = GetModuleFileNameW(NULL, wide_buffer, MAX_PATH);","path":"src/google/protobuf/compiler/command_line_interface.cc","position":8,"original_position":8,"commit_id":"9f0b234702674b2d45bd5b65f4121b82b8956188","original_commit_id":"9f0b234702674b2d45bd5b65f4121b82b8956188","user":{"login":"yukawa","id":5861397,"avatar_url":"https://avatars.githubusercontent.com/u/5861397?v=3","gravatar_id":"","url":"https://api.github.com/users/yukawa","html_url":"https://github.com/yukawa","followers_url":"https://api.github.com/users/yukawa/followers","following_url":"https://api.github.com/users/yukawa/following{/other_user}","gists_url":"https://api.github.com/users/yukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/yukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukawa/subscriptions","organizations_url":"https://api.github.com/users/yukawa/orgs","repos_url":"https://api.github.com/users/yukawa/repos","events_url":"https://api.github.com/users/yukawa/events{/privacy}","received_events_url":"https://api.github.com/users/yukawa/received_events","type":"User","site_admin":false},"body":"Yes almost always.  Basically what encoding is used in GetModuleFileNameA depends on system locale. For example it uses Shift-JIS (Codepage: 932 to be precise) when the system locale is Japanese.\r\n\r\nBasically GetModuleFileNameA exists for compatibility reasons to support applications that do not support Unicode at all. Depending on GetModuleFileNameA in newly implemented code doesn't make sense in almost all the situations.\r\n\r\n![region_settings](https://cloud.githubusercontent.com/assets/5861397/8897375/2d7007fe-33c9-11e5-95cb-0aa3d1d7cebb.png)","created_at":"2015-07-27T02:08:42Z","updated_at":"2015-07-27T02:08:42Z","html_url":"https://github.com/google/protobuf/pull/643#discussion_r35501919","pull_request_url":"https://api.github.com/repos/google/protobuf/pulls/643","_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments/35501919"},"html":{"href":"https://github.com/google/protobuf/pull/643#discussion_r35501919"},"pull_request":{"href":"https://api.github.com/repos/google/protobuf/pulls/643"}}},"pull_request":{"url":"https://api.github.com/repos/google/protobuf/pulls/643","id":40862855,"html_url":"https://github.com/google/protobuf/pull/643","diff_url":"https://github.com/google/protobuf/pull/643.diff","patch_url":"https://github.com/google/protobuf/pull/643.patch","issue_url":"https://api.github.com/repos/google/protobuf/issues/643","number":643,"state":"open","locked":false,"title":"Fix build failure on Windows when Unicode build is enabled.","user":{"login":"yukawa","id":5861397,"avatar_url":"https://avatars.githubusercontent.com/u/5861397?v=3","gravatar_id":"","url":"https://api.github.com/users/yukawa","html_url":"https://github.com/yukawa","followers_url":"https://api.github.com/users/yukawa/followers","following_url":"https://api.github.com/users/yukawa/following{/other_user}","gists_url":"https://api.github.com/users/yukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/yukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukawa/subscriptions","organizations_url":"https://api.github.com/users/yukawa/orgs","repos_url":"https://api.github.com/users/yukawa/repos","events_url":"https://api.github.com/users/yukawa/events{/privacy}","received_events_url":"https://api.github.com/users/yukawa/received_events","type":"User","site_admin":false},"body":"This is a follow up CL for e9abc404df99ef85d3e25aaaccd4aa83e381,\r\nwhich fails to deal with non-ASCII characters on Windows.\r\n\r\nThere are two problems in e9abc404df99ef85d3e25aaaccd4aa83e381b9\r\non Windows:\r\n  1. It causes build failure when UNICODE/_UNICODE macro are\r\n     defined.\r\n  2. It may not work if the path of protoc.exe contains any\r\n     non-ASCII characters.\r\n\r\nThis CL fixes 1. and partially addresses 2.  Now protoc.exe can\r\nbe built with UNICODE/_UNICODE macro defined, and the existence\r\nof unsupported characters can be detected as an error of\r\nGetProtocAbsolutePath() function.","created_at":"2015-07-27T00:24:27Z","updated_at":"2015-07-27T02:08:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c4587dafc7b7beff467004dd09c5bc3848a9514","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/protobuf/pulls/643/commits","review_comments_url":"https://api.github.com/repos/google/protobuf/pulls/643/comments","review_comment_url":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/protobuf/issues/643/comments","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/9f0b234702674b2d45bd5b65f4121b82b8956188","head":{"label":"yukawa:fix_win_unicode_build","ref":"fix_win_unicode_build","sha":"9f0b234702674b2d45bd5b65f4121b82b8956188","user":{"login":"yukawa","id":5861397,"avatar_url":"https://avatars.githubusercontent.com/u/5861397?v=3","gravatar_id":"","url":"https://api.github.com/users/yukawa","html_url":"https://github.com/yukawa","followers_url":"https://api.github.com/users/yukawa/followers","following_url":"https://api.github.com/users/yukawa/following{/other_user}","gists_url":"https://api.github.com/users/yukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/yukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukawa/subscriptions","organizations_url":"https://api.github.com/users/yukawa/orgs","repos_url":"https://api.github.com/users/yukawa/repos","events_url":"https://api.github.com/users/yukawa/events{/privacy}","received_events_url":"https://api.github.com/users/yukawa/received_events","type":"User","site_admin":false},"repo":{"id":39746830,"name":"protobuf","full_name":"yukawa/protobuf","owner":{"login":"yukawa","id":5861397,"avatar_url":"https://avatars.githubusercontent.com/u/5861397?v=3","gravatar_id":"","url":"https://api.github.com/users/yukawa","html_url":"https://github.com/yukawa","followers_url":"https://api.github.com/users/yukawa/followers","following_url":"https://api.github.com/users/yukawa/following{/other_user}","gists_url":"https://api.github.com/users/yukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/yukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukawa/subscriptions","organizations_url":"https://api.github.com/users/yukawa/orgs","repos_url":"https://api.github.com/users/yukawa/repos","events_url":"https://api.github.com/users/yukawa/events{/privacy}","received_events_url":"https://api.github.com/users/yukawa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yukawa/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":true,"url":"https://api.github.com/repos/yukawa/protobuf","forks_url":"https://api.github.com/repos/yukawa/protobuf/forks","keys_url":"https://api.github.com/repos/yukawa/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yukawa/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yukawa/protobuf/teams","hooks_url":"https://api.github.com/repos/yukawa/protobuf/hooks","issue_events_url":"https://api.github.com/repos/yukawa/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/yukawa/protobuf/events","assignees_url":"https://api.github.com/repos/yukawa/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/yukawa/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/yukawa/protobuf/tags","blobs_url":"https://api.github.com/repos/yukawa/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yukawa/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yukawa/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/yukawa/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yukawa/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/yukawa/protobuf/languages","stargazers_url":"https://api.github.com/repos/yukawa/protobuf/stargazers","contributors_url":"https://api.github.com/repos/yukawa/protobuf/contributors","subscribers_url":"https://api.github.com/repos/yukawa/protobuf/subscribers","subscription_url":"https://api.github.com/repos/yukawa/protobuf/subscription","commits_url":"https://api.github.com/repos/yukawa/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/yukawa/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/yukawa/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/yukawa/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/yukawa/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/yukawa/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yukawa/protobuf/merges","archive_url":"https://api.github.com/repos/yukawa/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yukawa/protobuf/downloads","issues_url":"https://api.github.com/repos/yukawa/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/yukawa/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/yukawa/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/yukawa/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yukawa/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/yukawa/protobuf/releases{/id}","created_at":"2015-07-27T00:03:22Z","updated_at":"2015-07-27T00:03:27Z","pushed_at":"2015-07-27T01:01:34Z","git_url":"git://github.com/yukawa/protobuf.git","ssh_url":"git@github.com:yukawa/protobuf.git","clone_url":"https://github.com/yukawa/protobuf.git","svn_url":"https://github.com/yukawa/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":49420,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"1647e63c57e2c2216da648e967686649e42a6346","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":23357588,"name":"protobuf","full_name":"google/protobuf","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/protobuf","description":"Protocol Buffers - Google's data interchange format","fork":false,"url":"https://api.github.com/repos/google/protobuf","forks_url":"https://api.github.com/repos/google/protobuf/forks","keys_url":"https://api.github.com/repos/google/protobuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/protobuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/protobuf/teams","hooks_url":"https://api.github.com/repos/google/protobuf/hooks","issue_events_url":"https://api.github.com/repos/google/protobuf/issues/events{/number}","events_url":"https://api.github.com/repos/google/protobuf/events","assignees_url":"https://api.github.com/repos/google/protobuf/assignees{/user}","branches_url":"https://api.github.com/repos/google/protobuf/branches{/branch}","tags_url":"https://api.github.com/repos/google/protobuf/tags","blobs_url":"https://api.github.com/repos/google/protobuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/protobuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/protobuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/protobuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/protobuf/statuses/{sha}","languages_url":"https://api.github.com/repos/google/protobuf/languages","stargazers_url":"https://api.github.com/repos/google/protobuf/stargazers","contributors_url":"https://api.github.com/repos/google/protobuf/contributors","subscribers_url":"https://api.github.com/repos/google/protobuf/subscribers","subscription_url":"https://api.github.com/repos/google/protobuf/subscription","commits_url":"https://api.github.com/repos/google/protobuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/protobuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/protobuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/protobuf/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/protobuf/contents/{+path}","compare_url":"https://api.github.com/repos/google/protobuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/protobuf/merges","archive_url":"https://api.github.com/repos/google/protobuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/protobuf/downloads","issues_url":"https://api.github.com/repos/google/protobuf/issues{/number}","pulls_url":"https://api.github.com/repos/google/protobuf/pulls{/number}","milestones_url":"https://api.github.com/repos/google/protobuf/milestones{/number}","notifications_url":"https://api.github.com/repos/google/protobuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/protobuf/labels{/name}","releases_url":"https://api.github.com/repos/google/protobuf/releases{/id}","created_at":"2014-08-26T15:52:15Z","updated_at":"2015-07-27T01:30:20Z","pushed_at":"2015-07-27T01:01:35Z","git_url":"git://github.com/google/protobuf.git","ssh_url":"git@github.com:google/protobuf.git","clone_url":"https://github.com/google/protobuf.git","svn_url":"https://github.com/google/protobuf","homepage":"https://developers.google.com/protocol-buffers/","size":49420,"stargazers_count":4286,"watchers_count":4286,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1162,"mirror_url":null,"open_issues_count":189,"forks":1162,"open_issues":189,"watchers":4286,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/protobuf/pulls/643"},"html":{"href":"https://github.com/google/protobuf/pull/643"},"issue":{"href":"https://api.github.com/repos/google/protobuf/issues/643"},"comments":{"href":"https://api.github.com/repos/google/protobuf/issues/643/comments"},"review_comments":{"href":"https://api.github.com/repos/google/protobuf/pulls/643/comments"},"review_comment":{"href":"https://api.github.com/repos/google/protobuf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/protobuf/pulls/643/commits"},"statuses":{"href":"https://api.github.com/repos/google/protobuf/statuses/9f0b234702674b2d45bd5b65f4121b82b8956188"}}}}