{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/14158","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/14158/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/14158/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/14158/events","html_url":"https://github.com/JuliaLang/julia/issues/14158","id":119083471,"number":14158,"title":"nextind UTF8String issue","user":{"login":"JobJob","id":854183,"avatar_url":"https://avatars.githubusercontent.com/u/854183?v=3","gravatar_id":"","url":"https://api.github.com/users/JobJob","html_url":"https://github.com/JobJob","followers_url":"https://api.github.com/users/JobJob/followers","following_url":"https://api.github.com/users/JobJob/following{/other_user}","gists_url":"https://api.github.com/users/JobJob/gists{/gist_id}","starred_url":"https://api.github.com/users/JobJob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JobJob/subscriptions","organizations_url":"https://api.github.com/users/JobJob/orgs","repos_url":"https://api.github.com/users/JobJob/repos","events_url":"https://api.github.com/users/JobJob/events{/privacy}","received_events_url":"https://api.github.com/users/JobJob/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-26T17:31:01Z","updated_at":"2015-11-27T14:15:43Z","closed_at":"2015-11-27T11:47:48Z","body":"    s = \"🛀🛀\" #a bath codepoint is 4 bytes long\r\n    s12 = s[1:2] # \"🛀\"\r\n    s56 = s[5:6] # \"?\" #the expected behaviour is this should be the same as s12?\r\n    sizeof(s12)  # 4\r\n    sizeof(s56)  # 2\r\n\r\nThe issue seems to be that:\r\n\r\n    nextind(s, 2) # 5\r\n    nextind(s, 6) # 7 (prob should be 9)\r\n\r\nI tried changing https://github.com/JuliaLang/julia/blob/master/base/strings/basic.jl#L141 to \r\n\r\n    return sizeof(s)+1\r\n\r\nand it seems to fix the problem. Additionally `julia5 runtests.jl unicode string strings/basic strings/io strings/search strings/types strings/util` succeeds after making this change and recompiling.\r\n\r\nShould I add some tests and submit a PR?"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/160148333","html_url":"https://github.com/JuliaLang/julia/issues/14158#issuecomment-160148333","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/14158","id":160148333,"user":{"login":"JobJob","id":854183,"avatar_url":"https://avatars.githubusercontent.com/u/854183?v=3","gravatar_id":"","url":"https://api.github.com/users/JobJob","html_url":"https://github.com/JobJob","followers_url":"https://api.github.com/users/JobJob/followers","following_url":"https://api.github.com/users/JobJob/following{/other_user}","gists_url":"https://api.github.com/users/JobJob/gists{/gist_id}","starred_url":"https://api.github.com/users/JobJob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JobJob/subscriptions","organizations_url":"https://api.github.com/users/JobJob/orgs","repos_url":"https://api.github.com/users/JobJob/repos","events_url":"https://api.github.com/users/JobJob/events{/privacy}","received_events_url":"https://api.github.com/users/JobJob/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T14:15:43Z","updated_at":"2015-11-27T14:15:43Z","body":"So both `s[1:2]` and `s[5:6]` would throw a UnicodeError? I'd need to rename the issue to something like \"Invalid string index don't cause errors\"?\r\n\r\nPlus it would be breaking for people who were doing the wrong thing previously (not right at the end of the string). Is everyone cool with that? Seems like might be better for someone (hint hint) to actually address #9297? \r\n\r\nHappy to do it of course, just want to get the green light first."}}