{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/31957096","id":31957096,"diff_hunk":"@@ -1719,3 +1719,102 @@ d = UTF32String(c)\n c[1] = 'A'\n @test d==\"A\"\n \n+# Test invalid sequences\n+\n+byt = 0x0","path":"test/strings.jl","position":6,"original_position":6,"commit_id":"7dbed9cc7e23fca47976c72dd6ef326a43f7efa0","original_commit_id":"7dbed9cc7e23fca47976c72dd6ef326a43f7efa0","user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"body":"is this line needed? and unnecessary indentation of the chunk of tests below this","created_at":"2015-06-08T20:41:13Z","updated_at":"2015-06-08T20:41:13Z","html_url":"https://github.com/JuliaLang/julia/pull/11575#discussion_r31957096","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11575","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/31957096"},"html":{"href":"https://github.com/JuliaLang/julia/pull/11575#discussion_r31957096"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11575"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/11575","id":36954484,"html_url":"https://github.com/JuliaLang/julia/pull/11575","diff_url":"https://github.com/JuliaLang/julia/pull/11575.diff","patch_url":"https://github.com/JuliaLang/julia/pull/11575.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11575","number":11575,"state":"open","locked":false,"title":"Add UTF encoding validity functions","user":{"login":"ScottPJones","id":11798751,"avatar_url":"https://avatars.githubusercontent.com/u/11798751?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottPJones","html_url":"https://github.com/ScottPJones","followers_url":"https://api.github.com/users/ScottPJones/followers","following_url":"https://api.github.com/users/ScottPJones/following{/other_user}","gists_url":"https://api.github.com/users/ScottPJones/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottPJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottPJones/subscriptions","organizations_url":"https://api.github.com/users/ScottPJones/orgs","repos_url":"https://api.github.com/users/ScottPJones/repos","events_url":"https://api.github.com/users/ScottPJones/events{/privacy}","received_events_url":"https://api.github.com/users/ScottPJones/received_events","type":"User","site_admin":false},"body":"This introduces the `Base.check_string` function, with methods for handling UTF-8, UTF-16, and UTF-32 as vectors of `UInt8`, `UInt16`, and `UInt32`, respectively, as well as an `AbstractString` version that operates on Unicode characters (making sure that they are all valid code points, `0 <= ch < 0xd800`, `0xe000 <= ch < 0x10ffff`).\r\nThere are options to accept or not accept things like `Modified UTF-8` encoding, or `CESU-8` encoding,\r\nor \"overly long\" encodings.  (See `utfcheck.jl` for documentation)\r\nThese methods either throw a `UnicodeError`, with information about which character was invalid, and\r\nits position in the input, or they return a tuple, of the number of logical characters in the string, a bit flag to indicate what types of data were found (i.e. all ASCII, all Latin1, surrogates present, overlong characters present, etc.), the number of characters that would take 2 bytes to encode in UTF-8, the number that would take 3 bytes, and the number that would take 4 bytes.\r\nThis information is designed to be useful for future conversion routines, because they allow one to calculate the exact size needed to represent a valid string in UTF-8, UTF-16, or UTF-32, and also\r\nindicate whether an optimized \"widening\" or \"narrowing\" conversion can be done.","created_at":"2015-06-04T16:48:00Z","updated_at":"2015-06-08T20:41:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc85299159d9fe601ae64b3863b013b38aad13e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11575/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11575/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11575/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/7dbed9cc7e23fca47976c72dd6ef326a43f7efa0","head":{"label":"ScottPJones:spj/checkstring","ref":"spj/checkstring","sha":"7dbed9cc7e23fca47976c72dd6ef326a43f7efa0","user":{"login":"ScottPJones","id":11798751,"avatar_url":"https://avatars.githubusercontent.com/u/11798751?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottPJones","html_url":"https://github.com/ScottPJones","followers_url":"https://api.github.com/users/ScottPJones/followers","following_url":"https://api.github.com/users/ScottPJones/following{/other_user}","gists_url":"https://api.github.com/users/ScottPJones/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottPJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottPJones/subscriptions","organizations_url":"https://api.github.com/users/ScottPJones/orgs","repos_url":"https://api.github.com/users/ScottPJones/repos","events_url":"https://api.github.com/users/ScottPJones/events{/privacy}","received_events_url":"https://api.github.com/users/ScottPJones/received_events","type":"User","site_admin":false},"repo":{"id":34334720,"name":"julia","full_name":"ScottPJones/julia","owner":{"login":"ScottPJones","id":11798751,"avatar_url":"https://avatars.githubusercontent.com/u/11798751?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottPJones","html_url":"https://github.com/ScottPJones","followers_url":"https://api.github.com/users/ScottPJones/followers","following_url":"https://api.github.com/users/ScottPJones/following{/other_user}","gists_url":"https://api.github.com/users/ScottPJones/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottPJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottPJones/subscriptions","organizations_url":"https://api.github.com/users/ScottPJones/orgs","repos_url":"https://api.github.com/users/ScottPJones/repos","events_url":"https://api.github.com/users/ScottPJones/events{/privacy}","received_events_url":"https://api.github.com/users/ScottPJones/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ScottPJones/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/ScottPJones/julia","forks_url":"https://api.github.com/repos/ScottPJones/julia/forks","keys_url":"https://api.github.com/repos/ScottPJones/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottPJones/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottPJones/julia/teams","hooks_url":"https://api.github.com/repos/ScottPJones/julia/hooks","issue_events_url":"https://api.github.com/repos/ScottPJones/julia/issues/events{/number}","events_url":"https://api.github.com/repos/ScottPJones/julia/events","assignees_url":"https://api.github.com/repos/ScottPJones/julia/assignees{/user}","branches_url":"https://api.github.com/repos/ScottPJones/julia/branches{/branch}","tags_url":"https://api.github.com/repos/ScottPJones/julia/tags","blobs_url":"https://api.github.com/repos/ScottPJones/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottPJones/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottPJones/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottPJones/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottPJones/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottPJones/julia/languages","stargazers_url":"https://api.github.com/repos/ScottPJones/julia/stargazers","contributors_url":"https://api.github.com/repos/ScottPJones/julia/contributors","subscribers_url":"https://api.github.com/repos/ScottPJones/julia/subscribers","subscription_url":"https://api.github.com/repos/ScottPJones/julia/subscription","commits_url":"https://api.github.com/repos/ScottPJones/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottPJones/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottPJones/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottPJones/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottPJones/julia/contents/{+path}","compare_url":"https://api.github.com/repos/ScottPJones/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottPJones/julia/merges","archive_url":"https://api.github.com/repos/ScottPJones/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottPJones/julia/downloads","issues_url":"https://api.github.com/repos/ScottPJones/julia/issues{/number}","pulls_url":"https://api.github.com/repos/ScottPJones/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottPJones/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottPJones/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottPJones/julia/labels{/name}","releases_url":"https://api.github.com/repos/ScottPJones/julia/releases{/id}","created_at":"2015-04-21T15:12:29Z","updated_at":"2015-05-08T00:23:59Z","pushed_at":"2015-06-08T20:35:31Z","git_url":"git://github.com/ScottPJones/julia.git","ssh_url":"git@github.com:ScottPJones/julia.git","clone_url":"https://github.com/ScottPJones/julia.git","svn_url":"https://github.com/ScottPJones/julia","homepage":"http://julialang.org/","size":73611,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"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":"JuliaLang:master","ref":"master","sha":"56342be6688bce36352ce6ef70edda86da16af07","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","created_at":"2011-04-21T07:01:50Z","updated_at":"2015-06-08T15:24:06Z","pushed_at":"2015-06-08T20:39:29Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":187291,"stargazers_count":5648,"watchers_count":5648,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1187,"mirror_url":null,"open_issues_count":1282,"forks":1187,"open_issues":1282,"watchers":5648,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11575"},"html":{"href":"https://github.com/JuliaLang/julia/pull/11575"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/11575"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/11575/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11575/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11575/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/7dbed9cc7e23fca47976c72dd6ef326a43f7efa0"}}}}