Christopher,
This seems suspiciously like a bug, please file a jira.
https://issues.apache.org/jira/browse/KNOX
A few questions:
1. What version of Knox?
2. Are you rewriting this portion of the json with any rewrite rules?
I'll try and add a test to confirm one way or the other.  If you could provide 
(in the jira) a mock of your service (e.g. Servlet, Jersey resource, WAR) 
ideally with your service definition files that would be very helpful.  Either 
way I'll try and add a test case to verify the current behavior.
Kevin.




On 3/2/16, 11:33 PM, "Christopher Jackson" <[email protected]> 
wrote:

>Hi All,
>
>We have a REST API sitting behind Knox and some of the endpoints in our API 
>return JSON with utf-8. Specifically we are prefixing some labels with UTF-8 
>charcters to test translation capabilities.  I am noticing that when we access 
>these endpoints through knox our UTF-8 characters are malformed. When we 
>access our API directly there is no issues. 
>
>I turned up logging in knox to see if I could capture what was going wrong but 
>I didn’t find much. I see that the request is made to the knox gateway, it’s 
>properly forwarded to the end point behind the gateway. Looking at the data on 
>the wire I see that the correct utf-8 encodings are being returned from our 
>end point. I don’t see any logging for what was returned after knox rewrote 
>the response. Is there anyway to enable this logging? 
>
>Here is a snippet of the log showing the encoding:
>
>2016-03-02 23:00:55,269 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-3 
><< "HTTP/1.1 200 OK[\r][\n]"
>2016-03-02 23:00:55,269 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-3 
><< "X-Powered-By: Servlet/3.0[\r][\n]"
>2016-03-02 23:00:55,270 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-3 
><< "Content-Type: application/json[\r][\n]"
>2016-03-02 23:00:55,270 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-3 
><< "Content-Length: 17560[\r][\n]"
>2016-03-02 23:00:55,270 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-3 
><< "Date: Thu, 03 Mar 2016 04:00:55 GMT[\r][\n]"
>2016-03-02 23:00:55,270 DEBUG http.wire (Wire.java:wire(72)) - http-outgoing-3 
><< "[\r][\n]"
>2016-03-02 23:00:55,271 DEBUG http.wire (Wire.java:wire(86)) - http-outgoing-3 
><< 
>"[{"numBuckets":3,"version":1,"standardizedAttributes":[{"version":1,"cmproleId":451,"stdrole1":29,"stdrole2":0,"dvdargs":"","minwgtfreq":20,"cmprole2Id":0,"stdfuncId":292,"attributeId":331,"equistrcodeId":0,"stdfuncLabel":"[0xc3][0x9f]_Person","anonstrcodeId":4654,"cmapstrcodeId":4662,"attributeLabel":"Per
> Business……..
>
>
>Below is a sample of how the labels are being malformed:
>
>Without Knox (expected output):
>“ß_Person"
>
>Through Knox:
>"ß_Person”
>
>-------------
>
>LATIN SMALL LETTER SHARP S
>"\u00DF" 
>
>is becoming 
>
>LATIN CAPITAL LETTER A WITH TILDE
>"\u00C3"       
>
>Any thoughts on how I might resolve this? Or best way to troubleshoot this 
>further? Let me know if you require more information about my knox setup and 
>rewrite rules.
>
>Regards,
>
>Christopher Jackson

Reply via email to