{"action":"created","issue":{"url":"https://api.github.com/repos/Samsung/iotjs/issues/121","labels_url":"https://api.github.com/repos/Samsung/iotjs/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/Samsung/iotjs/issues/121/comments","events_url":"https://api.github.com/repos/Samsung/iotjs/issues/121/events","html_url":"https://github.com/Samsung/iotjs/issues/121","id":93740395,"number":121,"title":"Introduce String wrapper for IoTjs","user":{"login":"ILyoan","id":2672194,"avatar_url":"https://avatars.githubusercontent.com/u/2672194?v=3","gravatar_id":"","url":"https://api.github.com/users/ILyoan","html_url":"https://github.com/ILyoan","followers_url":"https://api.github.com/users/ILyoan/followers","following_url":"https://api.github.com/users/ILyoan/following{/other_user}","gists_url":"https://api.github.com/users/ILyoan/gists{/gist_id}","starred_url":"https://api.github.com/users/ILyoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ILyoan/subscriptions","organizations_url":"https://api.github.com/users/ILyoan/orgs","repos_url":"https://api.github.com/users/ILyoan/repos","events_url":"https://api.github.com/users/ILyoan/events{/privacy}","received_events_url":"https://api.github.com/users/ILyoan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-08T09:09:12Z","updated_at":"2015-07-08T11:14:49Z","closed_at":null,"body":"From the start of the project we had used `char*` to represent ASCII string data. And from eef9e4ff7d45e3ffe851bf67f3157addbcd7410a it has changed to `jschar*` to represent UTF8 encoded string data.\r\n\r\nBut this change prevent using ASCII `char*` string data even if ascii data is itself UTF8 encoded. developers should use `JSCT` macro to convert `char*` to `jschar*` everywhere that could  be burden.\r\n\r\nMy plan is to introduce `String` class that is wrapping string data encoded with either ASCII or UTF8. And revert `JObject` member to provide ASCII string parameters instead of `jschar*` since I think there will be no problem exposing APIs that take ASCII string for ASCII can be converted to UTF8 without problems. But the member function should also take UTF8 string, here `String` plays role. By providing overloaded function that take `String` object that JObject binding functions will provide not only ASCII but also UTF8 string for its parameter."},"comment":{"url":"https://api.github.com/repos/Samsung/iotjs/issues/comments/119544049","html_url":"https://github.com/Samsung/iotjs/issues/121#issuecomment-119544049","issue_url":"https://api.github.com/repos/Samsung/iotjs/issues/121","id":119544049,"user":{"login":"ILyoan","id":2672194,"avatar_url":"https://avatars.githubusercontent.com/u/2672194?v=3","gravatar_id":"","url":"https://api.github.com/users/ILyoan","html_url":"https://github.com/ILyoan","followers_url":"https://api.github.com/users/ILyoan/followers","following_url":"https://api.github.com/users/ILyoan/following{/other_user}","gists_url":"https://api.github.com/users/ILyoan/gists{/gist_id}","starred_url":"https://api.github.com/users/ILyoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ILyoan/subscriptions","organizations_url":"https://api.github.com/users/ILyoan/orgs","repos_url":"https://api.github.com/users/ILyoan/repos","events_url":"https://api.github.com/users/ILyoan/events{/privacy}","received_events_url":"https://api.github.com/users/ILyoan/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T11:14:49Z","updated_at":"2015-07-08T11:14:49Z","body":"The total usage of memory for hold string data will be the same as before.\r\nCurrent implementation is like:\r\n```\r\njschar* buff = AllocateBuffer();\r\ncopy javascript string to buffer.\r\nLocalString refers the buffer.\r\nUse the LocalString object.\r\nBuffer will be freed when LocalString out of scope.\r\n```\r\n\r\nWill change to:\r\n```\r\nString object allocates buffer.\r\ncopy javascript string to String.\r\nUse the String object.\r\nBuffer will be freed when String out of scope.\r\n```\r\n\r\nAnd JObject binding will also become take String object for UTF8 and ANSI C(ASCII) string as well as `char*` for ASCII string.\r\n\r\nI think `char` should be enough to represent `byte` without confusion that `octet` and `jschar` could be removed from our source tree."}}