{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/195873365","pull_request_review_id":129331047,"id":195873365,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTg3MzM2NQ==","diff_hunk":"@@ -50,6 +50,11 @@ extern CTranslationInterface translationInterface;\n extern const char * const BITCOIN_CONF_FILENAME;\n extern const char * const BITCOIN_PID_FILENAME;\n \n+extern fs::detail::utf8_codecvt_facet g_utf8;\n+\n+#define u8string() string(g_utf8)\n+#define u8path(str) path(str, g_utf8)","path":"src/util.h","position":7,"original_position":7,"commit_id":"5dbd2489a6af49cc3afadac893e8f0fb141311a1","original_commit_id":"5dbd2489a6af49cc3afadac893e8f0fb141311a1","user":{"login":"ken2812221","id":11154118,"node_id":"MDQ6VXNlcjExMTU0MTE4","avatar_url":"https://avatars0.githubusercontent.com/u/11154118?v=4","gravatar_id":"","url":"https://api.github.com/users/ken2812221","html_url":"https://github.com/ken2812221","followers_url":"https://api.github.com/users/ken2812221/followers","following_url":"https://api.github.com/users/ken2812221/following{/other_user}","gists_url":"https://api.github.com/users/ken2812221/gists{/gist_id}","starred_url":"https://api.github.com/users/ken2812221/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ken2812221/subscriptions","organizations_url":"https://api.github.com/users/ken2812221/orgs","repos_url":"https://api.github.com/users/ken2812221/repos","events_url":"https://api.github.com/users/ken2812221/events{/privacy}","received_events_url":"https://api.github.com/users/ken2812221/received_events","type":"User","site_admin":false},"body":"I just thought that pass the second parameter at every `.string()` and `path()` is pretty annoying and easy to forget. If most developers don't want to use macro function, I could do a scipted-diff.","created_at":"2018-06-15T22:10:21Z","updated_at":"2018-06-15T22:10:22Z","html_url":"https://github.com/bitcoin/bitcoin/pull/13426#discussion_r195873365","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/195873365"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13426#discussion_r195873365"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426"}},"in_reply_to_id":195870172},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426","id":193834316,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzODM0MzE2","html_url":"https://github.com/bitcoin/bitcoin/pull/13426","diff_url":"https://github.com/bitcoin/bitcoin/pull/13426.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/13426.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13426","number":13426,"state":"open","locked":false,"title":"[bugfix] Add u8path and u8string to fix #13103","user":{"login":"ken2812221","id":11154118,"node_id":"MDQ6VXNlcjExMTU0MTE4","avatar_url":"https://avatars0.githubusercontent.com/u/11154118?v=4","gravatar_id":"","url":"https://api.github.com/users/ken2812221","html_url":"https://github.com/ken2812221","followers_url":"https://api.github.com/users/ken2812221/followers","following_url":"https://api.github.com/users/ken2812221/following{/other_user}","gists_url":"https://api.github.com/users/ken2812221/gists{/gist_id}","starred_url":"https://api.github.com/users/ken2812221/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ken2812221/subscriptions","organizations_url":"https://api.github.com/users/ken2812221/orgs","repos_url":"https://api.github.com/users/ken2812221/repos","events_url":"https://api.github.com/users/ken2812221/events{/privacy}","received_events_url":"https://api.github.com/users/ken2812221/received_events","type":"User","site_admin":false},"body":"Fix #13103 \r\n\r\nFrom https://github.com/bitcoin/bitcoin/pull/13107#issuecomment-385141831, @laanwj suggested that we should keep our internal strings to be always utf-8 encoded.\r\n\r\nThis PR adds two C++17 compatible macros: `u8string` and `u8path`. The reason that I use macros is that developers might not want to pass second parameter `utf8` everytime when they call `string` or create `path` objects.\r\n\r\nI tried to find all `string` methods and convert them to `u8string` except for external api calls. Also tried to convert explicit or implicit `path` to `u8path`. Tell me if you find something that I missed.","created_at":"2018-06-10T16:23:56Z","updated_at":"2018-06-15T22:10:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6de3b5d34227c8ef053a9e5fe5fd6aa5b7e7e1f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"theuni","id":417043,"node_id":"MDQ6VXNlcjQxNzA0Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/417043?v=4","gravatar_id":"","url":"https://api.github.com/users/theuni","html_url":"https://github.com/theuni","followers_url":"https://api.github.com/users/theuni/followers","following_url":"https://api.github.com/users/theuni/following{/other_user}","gists_url":"https://api.github.com/users/theuni/gists{/gist_id}","starred_url":"https://api.github.com/users/theuni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theuni/subscriptions","organizations_url":"https://api.github.com/users/theuni/orgs","repos_url":"https://api.github.com/users/theuni/repos","events_url":"https://api.github.com/users/theuni/events{/privacy}","received_events_url":"https://api.github.com/users/theuni/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":64585,"node_id":"MDU6TGFiZWw2NDU4NQ==","url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Bug","name":"Bug","color":"FBBAAB","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/13426/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/5dbd2489a6af49cc3afadac893e8f0fb141311a1","head":{"label":"ken2812221:u8path_u8string","ref":"u8path_u8string","sha":"5dbd2489a6af49cc3afadac893e8f0fb141311a1","user":{"login":"ken2812221","id":11154118,"node_id":"MDQ6VXNlcjExMTU0MTE4","avatar_url":"https://avatars0.githubusercontent.com/u/11154118?v=4","gravatar_id":"","url":"https://api.github.com/users/ken2812221","html_url":"https://github.com/ken2812221","followers_url":"https://api.github.com/users/ken2812221/followers","following_url":"https://api.github.com/users/ken2812221/following{/other_user}","gists_url":"https://api.github.com/users/ken2812221/gists{/gist_id}","starred_url":"https://api.github.com/users/ken2812221/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ken2812221/subscriptions","organizations_url":"https://api.github.com/users/ken2812221/orgs","repos_url":"https://api.github.com/users/ken2812221/repos","events_url":"https://api.github.com/users/ken2812221/events{/privacy}","received_events_url":"https://api.github.com/users/ken2812221/received_events","type":"User","site_admin":false},"repo":{"id":127176597,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxNzY1OTc=","name":"bitcoin","full_name":"ken2812221/bitcoin","owner":{"login":"ken2812221","id":11154118,"node_id":"MDQ6VXNlcjExMTU0MTE4","avatar_url":"https://avatars0.githubusercontent.com/u/11154118?v=4","gravatar_id":"","url":"https://api.github.com/users/ken2812221","html_url":"https://github.com/ken2812221","followers_url":"https://api.github.com/users/ken2812221/followers","following_url":"https://api.github.com/users/ken2812221/following{/other_user}","gists_url":"https://api.github.com/users/ken2812221/gists{/gist_id}","starred_url":"https://api.github.com/users/ken2812221/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ken2812221/subscriptions","organizations_url":"https://api.github.com/users/ken2812221/orgs","repos_url":"https://api.github.com/users/ken2812221/repos","events_url":"https://api.github.com/users/ken2812221/events{/privacy}","received_events_url":"https://api.github.com/users/ken2812221/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ken2812221/bitcoin","description":"Bitcoin Core integration/staging tree","fork":true,"url":"https://api.github.com/repos/ken2812221/bitcoin","forks_url":"https://api.github.com/repos/ken2812221/bitcoin/forks","keys_url":"https://api.github.com/repos/ken2812221/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ken2812221/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ken2812221/bitcoin/teams","hooks_url":"https://api.github.com/repos/ken2812221/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/ken2812221/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/ken2812221/bitcoin/events","assignees_url":"https://api.github.com/repos/ken2812221/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/ken2812221/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/ken2812221/bitcoin/tags","blobs_url":"https://api.github.com/repos/ken2812221/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ken2812221/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ken2812221/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/ken2812221/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ken2812221/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/ken2812221/bitcoin/languages","stargazers_url":"https://api.github.com/repos/ken2812221/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/ken2812221/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/ken2812221/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/ken2812221/bitcoin/subscription","commits_url":"https://api.github.com/repos/ken2812221/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/ken2812221/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/ken2812221/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/ken2812221/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/ken2812221/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/ken2812221/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ken2812221/bitcoin/merges","archive_url":"https://api.github.com/repos/ken2812221/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ken2812221/bitcoin/downloads","issues_url":"https://api.github.com/repos/ken2812221/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/ken2812221/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/ken2812221/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/ken2812221/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ken2812221/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/ken2812221/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/ken2812221/bitcoin/deployments","created_at":"2018-03-28T17:41:34Z","updated_at":"2018-06-15T01:49:13Z","pushed_at":"2018-06-15T18:20:31Z","git_url":"git://github.com/ken2812221/bitcoin.git","ssh_url":"git@github.com:ken2812221/bitcoin.git","clone_url":"https://github.com/ken2812221/bitcoin.git","svn_url":"https://github.com/ken2812221/bitcoin","homepage":"https://bitcoin.org/en/download","size":100736,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitcoin:master","ref":"master","sha":"a607d23ae82ee374799d21d02932d945c1ce9616","user":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgxOTI3","name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUyODg2MA==","avatar_url":"https://avatars2.githubusercontent.com/u/528860?v=4","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2018-06-15T22:06:31Z","pushed_at":"2018-06-15T20:43:58Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":101408,"stargazers_count":32515,"watchers_count":32515,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":19533,"mirror_url":null,"archived":false,"open_issues_count":809,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":19533,"open_issues":809,"watchers":32515,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/13426"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13426"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/13426/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/13426/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/5dbd2489a6af49cc3afadac893e8f0fb141311a1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ken2812221"}}