{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/spec/issues/213","labels_url":"https://api.github.com/repos/WebAssembly/spec/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/spec/issues/213/comments","events_url":"https://api.github.com/repos/WebAssembly/spec/issues/213/events","html_url":"https://github.com/WebAssembly/spec/issues/213","id":128036163,"number":213,"title":"Strings - Unicode or C","user":{"login":"fmccabe","id":3654349,"avatar_url":"https://avatars.githubusercontent.com/u/3654349?v=3","gravatar_id":"","url":"https://api.github.com/users/fmccabe","html_url":"https://github.com/fmccabe","followers_url":"https://api.github.com/users/fmccabe/followers","following_url":"https://api.github.com/users/fmccabe/following{/other_user}","gists_url":"https://api.github.com/users/fmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/fmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmccabe/subscriptions","organizations_url":"https://api.github.com/users/fmccabe/orgs","repos_url":"https://api.github.com/users/fmccabe/repos","events_url":"https://api.github.com/users/fmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/fmccabe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-21T22:29:38Z","updated_at":"2016-01-21T23:51:46Z","closed_at":null,"body":"I cannot locate any specification within the spec regarding strings. So, my questions are:\r\n\r\n1. Is the zero-terminated string baked into wasm? (If so, why?)\r\n2. What about Unicode? What is the semantics of a string literal, of a block of memory interpreted as a string?\r\n\r\nIf this question has already been answered, please point me to the spec."},"comment":{"url":"https://api.github.com/repos/WebAssembly/spec/issues/comments/173753045","html_url":"https://github.com/WebAssembly/spec/issues/213#issuecomment-173753045","issue_url":"https://api.github.com/repos/WebAssembly/spec/issues/213","id":173753045,"user":{"login":"fmccabe","id":3654349,"avatar_url":"https://avatars.githubusercontent.com/u/3654349?v=3","gravatar_id":"","url":"https://api.github.com/users/fmccabe","html_url":"https://github.com/fmccabe","followers_url":"https://api.github.com/users/fmccabe/followers","following_url":"https://api.github.com/users/fmccabe/following{/other_user}","gists_url":"https://api.github.com/users/fmccabe/gists{/gist_id}","starred_url":"https://api.github.com/users/fmccabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmccabe/subscriptions","organizations_url":"https://api.github.com/users/fmccabe/orgs","repos_url":"https://api.github.com/users/fmccabe/repos","events_url":"https://api.github.com/users/fmccabe/events{/privacy}","received_events_url":"https://api.github.com/users/fmccabe/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T23:51:46Z","updated_at":"2016-01-21T23:51:46Z","body":"If imports/exports have null termination, this must be only a property of the binary encoding of wasm files. \n\nHowever, I have seen at least one unit test (https://github.com/WebAssembly/testsuite/blob/master/address.wast) where there are string literals in main code; and the assumption that it was ASCII (i.e., one byte/char) and null-terminated is part of the test.\n\nEither strings *are* permitted in wasm files’ memory sections, in which case string representation *must* be decided, or they should *not* be permitted. There is no middle ground here.\n\nPersonally, I can see arguments on all sides. As it happens, I think that a ‘common’ string format is more-or-less inevitable; so it would be better to get in front of that issue.\n\n> On Jan 21, 2016, at 3:37 PM, Katelyn Gadd <notifications@github.com> wrote:\n> \n> Null terminated strings are smaller, even after stream compression. However, that really only matters if you have a bunch of them. So it would be perfectly reasonable to encode length values for import/export names and most other names in a module.\n> \n> —\n> Reply to this email directly or view it on GitHub <https://github.com/WebAssembly/spec/issues/213#issuecomment-173750572>.\n> \n\n"}}