Hello,
I have troubles with "getChildren" method in Confluence JSON-RPC API.
For Confluence pages with special characters in title, the API returns wrong text - instead of the special/foreign characters, there are wrong characters. See example:
[ { "version": 1, "parentId": 28148060, "permissions": 0, "id": 28835879, "space": "TEST", "title": "Copy of Will s��", "url": "https://confluence:8443/pages/viewpage.action?pageId=28835879" }, { "version": 1, "parentId": 28148060, "permissions": 0, "id": 29753574, "space": "TEST", "title": "Special chars-�??�?�?b��", "url": "https://confluence:8443/pages/viewpage.action?pageId=29753574" }, { "version": 3, "parentId": 28148060, "permissions": 0, "id": 28835875, "space": "TEST", "title": "Will s��", "url": "https://confluence:8443/pages/viewpage.action?pageId=28835875" } ]
Characters encoding in Confluence itself is ok, without problems. I did also the encoding test and all went fine (http://confluence.atlassian.com/admin/encodingtest.action).
About the getChildren API request - I tried some HTTP headers, like "Accept-Charset", but no change.
Content-Type : application/json; charset=utf-8
Accept-Charset : ISO-8859-1,utf-8;q=0.7,*;q=0.7
Is it bug, or I have something wrong here?
Community moderators have prevented the ability to post new answers.
The problem is that the character encoding in the plugin is ISO-8859-1, rather than UTF-8. Unfortunately the plugin does not respond to the Accept-Charset header, or the charset parameter in the Accept header. As an alternative I have submitted a pull request for the plugin to set the character encoding to UTF-8. Hopefully it will be merged, but if not, you could always customize the plugin and upload your changes manually. Here's the pull request with the code changes:
https://bitbucket.org/cmiller_atlassian/confluence-json-rpc-plugin/pull-request/5/set-character-encoding-to-utf-8-when/diff
Hope this helps!
To my knowledge, JSON resources must be encoded in UTF-8. Wikipedia states that it is the default charset.
You might try to set this as your preferred Accept-Charset. Also look at the response Headers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The JSON-RPC plugin apparently is i18n-ignorant -- https://bitbucket.org/cmiller_atlassian/confluence-json-rpc-plugin/issue/15/chinese-words-encoding-problem-with-json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
all this is related to Confluence 4.2.8, forgot to mention...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.