{"action":"created","issue":{"url":"https://api.github.com/repos/kyren/rlua/issues/94","repository_url":"https://api.github.com/repos/kyren/rlua","labels_url":"https://api.github.com/repos/kyren/rlua/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/kyren/rlua/issues/94/comments","events_url":"https://api.github.com/repos/kyren/rlua/issues/94/events","html_url":"https://github.com/kyren/rlua/issues/94","id":365241751,"node_id":"MDU6SXNzdWUzNjUyNDE3NTE=","number":94,"title":"Non-utf8 string support","user":{"login":"vorner","id":11783500,"node_id":"MDQ6VXNlcjExNzgzNTAw","avatar_url":"https://avatars2.githubusercontent.com/u/11783500?v=4","gravatar_id":"","url":"https://api.github.com/users/vorner","html_url":"https://github.com/vorner","followers_url":"https://api.github.com/users/vorner/followers","following_url":"https://api.github.com/users/vorner/following{/other_user}","gists_url":"https://api.github.com/users/vorner/gists{/gist_id}","starred_url":"https://api.github.com/users/vorner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vorner/subscriptions","organizations_url":"https://api.github.com/users/vorner/orgs","repos_url":"https://api.github.com/users/vorner/repos","events_url":"https://api.github.com/users/vorner/events{/privacy}","received_events_url":"https://api.github.com/users/vorner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-30T17:05:31Z","updated_at":"2018-10-01T09:29:45Z","closed_at":null,"author_association":"NONE","body":"Hello\r\n\r\nLua's strings allow whatever inside them. This is in odds with what Rust mandates from its `str` and `String`. However, the API mostly translates the Lua strings to Rust's `str`, at least in the direction Rust → Lua. Which is mostly OK, but at times it is needed to pass data that is not guaranteed to be utf8 ‒ content of lua script from file, `PathBuf`, or outright binary blob (which lua usually stores as string too).\r\n\r\nThis is from the lua documentation:\r\n\r\n> The type string represents immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\\0'). Lua is also encoding-agnostic; it makes no assumptions about the contents of a string. \r\n\r\nWhat would be a good way to allow sending arbitrary sequence of bytes to lua? It doesn't have to be the most convenient one, but not being able to pass it seems limiting."},"comment":{"url":"https://api.github.com/repos/kyren/rlua/issues/comments/425844457","html_url":"https://github.com/kyren/rlua/issues/94#issuecomment-425844457","issue_url":"https://api.github.com/repos/kyren/rlua/issues/94","id":425844457,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTg0NDQ1Nw==","user":{"login":"kyren","id":1538607,"node_id":"MDQ6VXNlcjE1Mzg2MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/1538607?v=4","gravatar_id":"","url":"https://api.github.com/users/kyren","html_url":"https://github.com/kyren","followers_url":"https://api.github.com/users/kyren/followers","following_url":"https://api.github.com/users/kyren/following{/other_user}","gists_url":"https://api.github.com/users/kyren/gists{/gist_id}","starred_url":"https://api.github.com/users/kyren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyren/subscriptions","organizations_url":"https://api.github.com/users/kyren/orgs","repos_url":"https://api.github.com/users/kyren/repos","events_url":"https://api.github.com/users/kyren/events{/privacy}","received_events_url":"https://api.github.com/users/kyren/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T09:29:45Z","updated_at":"2018-10-01T09:29:45Z","author_association":"OWNER","body":"I can also change the API to allow non-utf8 lua programs, I can't really think of a reason not to.\r\n\r\nAs far as making something like a custom ByteString type, I think that's probably something that would be better for users of the library to use.  Also, making such a wrapper take a Vec<u8> could potentially be very wasteful since Lua wouldn't adopt the storage behind the Vec, it has to copy in all cases."}}
{"actor":{"display_login":"kyren"}}