{"action":"created","issue":{"url":"https://api.github.com/repos/ironSource/node-regedit/issues/12","labels_url":"https://api.github.com/repos/ironSource/node-regedit/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/ironSource/node-regedit/issues/12/comments","events_url":"https://api.github.com/repos/ironSource/node-regedit/issues/12/events","html_url":"https://github.com/ironSource/node-regedit/issues/12","id":115380457,"number":12,"title":"regedit.list() throws SyntaxError when data includes tab (s)","user":{"login":"mh61503891","id":706275,"avatar_url":"https://avatars.githubusercontent.com/u/706275?v=3","gravatar_id":"","url":"https://api.github.com/users/mh61503891","html_url":"https://github.com/mh61503891","followers_url":"https://api.github.com/users/mh61503891/followers","following_url":"https://api.github.com/users/mh61503891/following{/other_user}","gists_url":"https://api.github.com/users/mh61503891/gists{/gist_id}","starred_url":"https://api.github.com/users/mh61503891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh61503891/subscriptions","organizations_url":"https://api.github.com/users/mh61503891/orgs","repos_url":"https://api.github.com/users/mh61503891/repos","events_url":"https://api.github.com/users/mh61503891/events{/privacy}","received_events_url":"https://api.github.com/users/mh61503891/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-05T21:38:32Z","updated_at":"2015-11-05T23:23:41Z","closed_at":null,"body":"For example, \"Adobe Acrobat Reader DC - Japanese\" writes following entry to registry when installing:\r\n\r\n- ValueName = Comments\r\n- Type = REG_SZ\r\n- Data = \\n\\t\\t\\t\\n\r\n\r\nThis entry has a data including new lines and tabs, and the regedit.list() throws SyntaxError when reading above entry as follow:\r\n\r\n```\r\nUncaught SyntaxError: Unexpected token\r\nat Object.parse (native)\r\nat DestroyableTransform.module.exports.vbsOutputTransform [as _transform] (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\lib\\helper.js:51:18)\r\nat DestroyableTransform.Transform._read (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\through2\\node_modules\\readable-stream\\lib\\_stre\r\n_transform.js:184:10)\r\nat DestroyableTransform.Transform._write (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\through2\\node_modules\\readable-stream\\lib\\_str\r\nm_transform.js:172:12)\r\nat doWrite (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\through2\\node_modules\\readable-stream\\lib\\_stream_writable.js:237:10)\r\nat writeOrBuffer (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\through2\\node_modules\\readable-stream\\lib\\_stream_writable.js:227:5)\r\nat DestroyableTransform.Writable.write (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\through2\\node_modules\\readable-stream\\lib\\_strea\r\nwritable.js:194:11)\r\nat StreamSlicer.ondata (_stream_readable.js:528:20)\r\nat readableAddChunk (_stream_readable.js:146:16)\r\nat StreamSlicer.Readable.push (_stream_readable.js:110:10)\r\nat StreamSlicer.Transform.push (_stream_transform.js:128:32)\r\nat StreamSlicer._separatorFlush (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\stream-slicer\\index.js:63:7)\r\nat StreamSlicer._transform (Z:\\hakuto\\hakuto-client\\node_modules\\regedit\\node_modules\\stream-slicer\\index.js:33:8)\r\nat StreamSlicer.Transform._read (_stream_transform.js:167:10)\r\nat StreamSlicer.Transform._write (_stream_transform.js:155:12)\r\nat doWrite (_stream_writable.js:292:12)\r\nat writeOrBuffer (_stream_writable.js:278:5)\r\nat StreamSlicer.Writable.write (_stream_writable.js:207:11)\r\nat Socket.ondata (_stream_readable.js:528:20)\r\nat readableAddChunk (_stream_readable.js:146:16)\r\nat Socket.Readable.push (_stream_readable.js:110:10)\r\nat Pipe.onread (net.js:523:20)\r\n```\r\n\r\nProbably, this SyntaxError occurred if data includes tab (s). To check this, I have inputed a tab into other entry by regedit.exe then regedit.list() throws same error."},"comment":{"url":"https://api.github.com/repos/ironSource/node-regedit/issues/comments/154228216","html_url":"https://github.com/ironSource/node-regedit/issues/12#issuecomment-154228216","issue_url":"https://api.github.com/repos/ironSource/node-regedit/issues/12","id":154228216,"user":{"login":"mh61503891","id":706275,"avatar_url":"https://avatars.githubusercontent.com/u/706275?v=3","gravatar_id":"","url":"https://api.github.com/users/mh61503891","html_url":"https://github.com/mh61503891","followers_url":"https://api.github.com/users/mh61503891/followers","following_url":"https://api.github.com/users/mh61503891/following{/other_user}","gists_url":"https://api.github.com/users/mh61503891/gists{/gist_id}","starred_url":"https://api.github.com/users/mh61503891/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mh61503891/subscriptions","organizations_url":"https://api.github.com/users/mh61503891/orgs","repos_url":"https://api.github.com/users/mh61503891/repos","events_url":"https://api.github.com/users/mh61503891/events{/privacy}","received_events_url":"https://api.github.com/users/mh61503891/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T23:23:41Z","updated_at":"2015-11-05T23:23:41Z","body":"https://github.com/ironSource/node-regedit/blob/45514bed635114891589abc2c554458417c3b8fc/vbs/util.vbs#L117\r\n\r\nAdditional replacement processes to escape extended characters (e.g., tab, backspace, etc.) are needed in Function JsonSafe.\r\n\r\nThe replacement rule are written in RFC 4627 Section \"2.5. Strings\" https://www.ietf.org/rfc/rfc4627.txt, page 4."}}