Hi Eric, Thanks for Responding.
We are calling MarkLogic Custom services using apache commons http client to get the data. We are getting the response as UTF-8 encoded only. final HttpResponse response = httpClientExecutor.execute(request, globalProperties.getProperty(MARKLOGIC_USERNAME), globalProperties.getProperty(MARKLOGIC_PASSWORD)); response.getEntity() is still in UTF-8 encoding only. We are converting response entity to string and creating JSON object final String strEntiry = EntityUtils.toString(response.getEntity()); When we debug ,At this point it self we are not receiving the special characters properly and getting some dirty characters in place of special characters. return new JSONObject(strEntiry); And we tried reading strEntiry as UTF-8 encoded explicitly like below final String strEntiry = EntityUtils.toString(response.getEntity(),"UTF-8"); but the result is same. Thanks, Vinod. -----Original Message----- From: general-boun...@developer.marklogic.com [mailto:general-boun...@developer.marklogic.com] On Behalf Of general-requ...@developer.marklogic.com Sent: Wednesday, October 05, 2016 6:20 PM To: general@developer.marklogic.com Subject: General Digest, Vol 148, Issue 7 Send General mailing list submissions to general@developer.marklogic.com To subscribe or unsubscribe via the World Wide Web, visit http://developer.marklogic.com/mailman/listinfo/general or, via email, send a message with subject or body 'help' to general-requ...@developer.marklogic.com You can reach the person managing the list at general-ow...@developer.marklogic.com When replying, please edit your Subject line so it is more specific than "Re: Contents of General digest..." Today's Topics: 1. Re: Issue with special charecters in MarkLogic (Kapoor, Pragya) 2. Re: Issue with special charecters in MarkLogic (Erik Hennum) ---------------------------------------------------------------------- Message: 1 Date: Wed, 5 Oct 2016 11:06:51 +0000 From: "Kapoor, Pragya" <pkapo...@innodata.com> Subject: Re: [MarkLogic Dev General] Issue with special charecters in MarkLogic To: "general@developer.marklogic.com" <general@developer.marklogic.com> Message-ID: <hk2pr02mb1364317fedef56e787a424ceea...@hk2pr02mb1364.apcprd02.prod.outlook.com> Content-Type: text/plain; charset="us-ascii" You can try using xdmp:url-decode() Example: let $write := ""write 𝘢(𝘹)/𝘣(𝘹))" return xdmp:url-decode($write) This will give the output as " write ?(?)/?(?) Thanks Pragya ________________________________ From: general-boun...@developer.marklogic.com <general-boun...@developer.marklogic.com> on behalf of thangella.vinodre...@cognizant.com <thangella.vinodre...@cognizant.com> Sent: Wednesday, October 5, 2016 3:53:16 PM To: general@developer.marklogic.com Subject: [MarkLogic Dev General] Issue with special charecters in MarkLogic Hi All, We are facing an issue with special characters involved in mathematical expressions such as " write ?(?)/?(?) in the form " which has italic characters (?(?)/?(?)). In MarkLogic these are stored as UTF-8 encoded values as "write 𝘢(𝘹)/𝘣(𝘹) in the form". In Java application When we are retrieving data from MarkLogic DB ,these special characters are being received as " write ?c(?^1)/??(?^1) in the form" . These are being corrupted by the time we received them in Java layer. We tried many options from Java side to receive content as UTF-8 encoded, but did not resolved the issue. Can anyone please suggest a way to resolve this kind of issues from MarkLogic side. Thanks, Vinod. This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored. "This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful." -------------- next part -------------- An HTML attachment was scrubbed... URL: http://developer.marklogic.com/pipermail/general/attachments/20161005/672a0faf/attachment-0001.html ------------------------------ Message: 2 Date: Wed, 5 Oct 2016 12:50:25 +0000 From: Erik Hennum <erik.hen...@marklogic.com> Subject: Re: [MarkLogic Dev General] Issue with special charecters in MarkLogic To: MarkLogic Developer Discussion <general@developer.marklogic.com> Message-ID: <dfdf2fd50bf5aa42adaf93ff2e3ca1850bd35...@exchg10-be01.marklogic.com> Content-Type: text/plain; charset="utf-8" Hi, Vinod: If you read the character stream as UTF-8 in Java, you shouldn't need to do anything special on either the client or server. Are you using the MarkLogic Java Client API? The Java API knows the server encodes as UTF-8 and defaults to reading as UTF-8. The only other question that occurs to me is whether the code that's writing the content might be double encoding. Hoping that helps, Erik Hennum ________________________________ From: general-boun...@developer.marklogic.com [general-boun...@developer.marklogic.com] on behalf of thangella.vinodre...@cognizant.com [thangella.vinodre...@cognizant.com] Sent: Wednesday, October 05, 2016 3:23 AM To: general@developer.marklogic.com Subject: [MarkLogic Dev General] Issue with special charecters in MarkLogic Hi All, We are facing an issue with special characters involved in mathematical expressions such as ? write ?(?)/?(?) in the form ? which has italic characters (?(?)/?(?)). In MarkLogic these are stored as UTF-8 encoded values as ?write 𝘢(𝘹)/𝘣(𝘹) in the form?. In Java application When we are retrieving data from MarkLogic DB ,these special characters are being received as ? write ??(??)/??(??) in the form? . These are being corrupted by the time we received them in Java layer. We tried many options from Java side to receive content as UTF-8 encoded, but did not resolved the issue. Can anyone please suggest a way to resolve this kind of issues from MarkLogic side. Thanks, Vinod. This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://developer.marklogic.com/pipermail/general/attachments/20161005/44e370e6/attachment.html ------------------------------ _______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general End of General Digest, Vol 148, Issue 7 *************************************** This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored. _______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general