{"action":"created","issue":{"url":"https://api.github.com/repos/angelozerr/tern.java/issues/364","labels_url":"https://api.github.com/repos/angelozerr/tern.java/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/angelozerr/tern.java/issues/364/comments","events_url":"https://api.github.com/repos/angelozerr/tern.java/issues/364/events","html_url":"https://github.com/angelozerr/tern.java/issues/364","id":115723698,"number":364,"title":"[JSDoc] Support for Chinese character","user":{"login":"angelozerr","id":1932211,"avatar_url":"https://avatars.githubusercontent.com/u/1932211?v=3","gravatar_id":"","url":"https://api.github.com/users/angelozerr","html_url":"https://github.com/angelozerr","followers_url":"https://api.github.com/users/angelozerr/followers","following_url":"https://api.github.com/users/angelozerr/following{/other_user}","gists_url":"https://api.github.com/users/angelozerr/gists{/gist_id}","starred_url":"https://api.github.com/users/angelozerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angelozerr/subscriptions","organizations_url":"https://api.github.com/users/angelozerr/orgs","repos_url":"https://api.github.com/users/angelozerr/repos","events_url":"https://api.github.com/users/angelozerr/events{/privacy}","received_events_url":"https://api.github.com/users/angelozerr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-08T10:44:10Z","updated_at":"2015-11-09T09:23:30Z","closed_at":null,"body":"This issue comes from https://github.com/angelozerr/tern-jshint/issues/2. Here a JavaScript snippet with Chinese comment:\r\n\r\n```javascript\r\nvar test_obj = {\r\n    /**\r\n     * English: this is a test function<br/>\r\n     * Chinese: 这是一个测试函数\r\n     */\r\n    test_func: function() {\r\n    }\r\n}\r\n```\r\n\r\nThe Hover, Completion, shows \"??????\" instead of showing \" 这是一个测试函数\".\r\n\r\nProblem comes from the Http post client (from tern.java) which doesn't encode the request/response. To fix problem, we need to set encoding like this : \r\n\r\n * request: \r\n\r\n```java\r\nhttpPost.setEntity(new StringEntity(doc.toString(), \"UTF-8\"));\r\n```\r\n\r\n (see https://github.com/angelozerr/tern.java/blob/master/core/tern.server.nodejs/src/tern/server/nodejs/NodejsTernHelper.java#L124)\r\n\r\n * response:\r\n\r\n```java\r\nJsonObject response = JsonObject\t.readFrom(new InputStreamReader(in, \"UTF-8\"));\r\n```\r\n(see https://github.com/angelozerr/tern.java/blob/master/core/tern.server.nodejs/src/tern/server/nodejs/NodejsTernHelper.java#L90)\r\n\r\nBut I think we should use the tect editor encoding instead of using hard coded encoding.\r\n\r\nAs it's a important changes, I will not do that in 1.1.0 which will be released soon.\r\n\r\n@mickaelistria @vrubezhny @dgolovin @maxandersen @PaulVI @fbricon @piotrtomiak it's a very important changes, so are you OK I force the encoding of http request/response from the text editor encoding?\r\n"},"comment":{"url":"https://api.github.com/repos/angelozerr/tern.java/issues/comments/155005748","html_url":"https://github.com/angelozerr/tern.java/issues/364#issuecomment-155005748","issue_url":"https://api.github.com/repos/angelozerr/tern.java/issues/364","id":155005748,"user":{"login":"mickaelistria","id":469058,"avatar_url":"https://avatars.githubusercontent.com/u/469058?v=3","gravatar_id":"","url":"https://api.github.com/users/mickaelistria","html_url":"https://github.com/mickaelistria","followers_url":"https://api.github.com/users/mickaelistria/followers","following_url":"https://api.github.com/users/mickaelistria/following{/other_user}","gists_url":"https://api.github.com/users/mickaelistria/gists{/gist_id}","starred_url":"https://api.github.com/users/mickaelistria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickaelistria/subscriptions","organizations_url":"https://api.github.com/users/mickaelistria/orgs","repos_url":"https://api.github.com/users/mickaelistria/repos","events_url":"https://api.github.com/users/mickaelistria/events{/privacy}","received_events_url":"https://api.github.com/users/mickaelistria/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T09:23:30Z","updated_at":"2015-11-09T09:23:30Z","body":"I agree it seems more consistent to use the text editor encoding (usually set to UTF-8) for that operation rather than relying on the JVM encoding (usually set to Cp-1215 or other on Windows). I believe it's not such a critical change, although a very useful one, so IMO if it can fit in 1.1.0, it's a good candidate to get in."}}