{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/683","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/683/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/683/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/683/events","html_url":"https://github.com/rust-lang/rfcs/issues/683","id":55070009,"number":683,"title":"bytes!() should encode to ASCII instead of UTF-8","user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/A-wishlist","name":"A-wishlist","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-21T20:06:59Z","updated_at":"2015-01-21T20:41:40Z","closed_at":"2015-01-21T20:41:40Z","body":"<a href=\"https://github.com/SimonSapin\"><img src=\"https://avatars.githubusercontent.com/u/291359?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [SimonSapin](https://github.com/SimonSapin)**\n_Monday May 05, 2014 at 23:26 GMT_\n\n_For earlier discussion, see https://github.com/rust-lang/rust/issues/13955_\n\n_This issue was labelled with: B-RFC in the Rust repository_\n\n----\n\n**Update:** The original title was *bytes!() should encode to \"Latin-1\" instead of UTF-8*, but Latin-1 turned out to be not such a good idea. See discussion below.\r\n\r\n----\r\n\r\nCurrently, the `bytes!()` macro encodes character and string arguments as UTF-8. This gives surprising behavior such as `bytes!(\"\\xFF\") == [0xC3, 0xBF]` instead of `[0xFF]`.\r\n\r\nThis macro should not assume UTF-8, since its typical use case is working with bytes in an encoding that is ASCII-compatible but is not necessarily UTF-8.\r\n\r\nInstead, it should map code points in the  U+0000 .. U+00FF range to bytes with the same numerical value, and trigger a compile-time error for other code points. (This encoding sometimes known as \"Latin-1\", although the official definition of [ISO/IEC 8859-1:1998](https://en.wikipedia.org/wiki/Latin1) leaves some bytes unmapped.)\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/70917310","html_url":"https://github.com/rust-lang/rfcs/issues/683#issuecomment-70917310","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/683","id":70917310,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T20:41:40Z","updated_at":"2015-01-21T20:41:40Z","body":"@reem well with `bytes` specifically, since it was removed, there is also an RFC to bring it back, so I thought this would be relevant."}}