{"action":"opened","issue":{"url":"https://api.github.com/repos/TooTallNate/ref/issues/41","labels_url":"https://api.github.com/repos/TooTallNate/ref/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/TooTallNate/ref/issues/41/comments","events_url":"https://api.github.com/repos/TooTallNate/ref/issues/41/events","html_url":"https://github.com/TooTallNate/ref/issues/41","id":108516925,"number":41,"title":"ref.allocCString with encoding 'utf16le'","user":{"login":"zetsingithub","id":3872744,"avatar_url":"https://avatars.githubusercontent.com/u/3872744?v=3","gravatar_id":"","url":"https://api.github.com/users/zetsingithub","html_url":"https://github.com/zetsingithub","followers_url":"https://api.github.com/users/zetsingithub/followers","following_url":"https://api.github.com/users/zetsingithub/following{/other_user}","gists_url":"https://api.github.com/users/zetsingithub/gists{/gist_id}","starred_url":"https://api.github.com/users/zetsingithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetsingithub/subscriptions","organizations_url":"https://api.github.com/users/zetsingithub/orgs","repos_url":"https://api.github.com/users/zetsingithub/repos","events_url":"https://api.github.com/users/zetsingithub/events{/privacy}","received_events_url":"https://api.github.com/users/zetsingithub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-27T06:05:22Z","updated_at":"2015-09-27T06:05:22Z","closed_at":null,"body":"Inside the function of ref.allocCString:\r\nvar size = Buffer.byteLength(string, encoding) + 1\r\n\r\nThere is error while setting encoding 'utf16le',  because utf16 string terminator is  the two-byte sequence 0x00 0x00. Maybe you should do this:\r\nvar size = Buffer.byteLength(string + '\\0', encoding)"}}