2014-03-14 22:17 GMT+01:00 Sergey Beryozkin <[email protected]>: > Hi, sure, see changes at > https://issues.apache.org/jira/browse/CXF-5619
Hi: I was having a look at this bug and I've seen that you fixed it for createStreamWriter() method( I tested it and it works fine ) but you didn't it for createStreamReader() method, any reason ? I think the solution is in JSONUtils.java source class, in the line with new JettisonReader(namespaceMap, factory.createXMLStreamReader(is)); Should it be factory.createXMLStreamReader(is, enc) ? So I guess it should be a String enc = HttpUtils.getSetEncoding(m, headers, "UTF-8"); in T readFrom(Class<T> type, Type genericType, Annotation[] anns, MediaType mt, MultivaluedMap<String, String> headers, InputStream is) And another question : what about these methods public static XMLStreamWriter createBadgerFishWriter(OutputStream os) throws XMLStreamException public static XMLStreamReader createBadgerFishReader(InputStream is) throws XMLStreamException ? Should they have a encoding parameter ? Thanks and regards > > Cheers, Sergey > > On 14/03/14 18:06, Jose María Zaragoza wrote: >> >> 2014-03-14 18:41 GMT+01:00 Sergey Beryozkin <[email protected]>: >>> >>> Fortunately the bug is in CXF JSONUtils, whcih always passes UTF-8 to >>> Jettison. So it's now fixed, thanks for spotting it >> >> >> >> Thank you >> >> How can I get this JSONUtils fixed ? >> I would like to backport this patch to CXF 2.7.8 , could you help me >> to know the line(s) fixed ? >> >> >> Regards >> >> >> >> >>> >>> Cheers, Sergey >>> >>> >>> On 14/03/14 16:02, Sergey Beryozkin wrote: >>>> >>>> >>>> Looks like it is something related to Jettison...XML works OK. >>>> Need to investigate more. >>>> >>>> Thanks, Sergey >>>> >>>> >>>> On 14/03/14 12:29, Jose María Zaragoza wrote: >>>>> >>>>> >>>>> I've got to return "application/json;charset=iso-8859-1" but >>>>> i've checked that it always returns UTF-8 encoding >>>>> >>>>> I tested with universalchardet by Mozilla , with Firefox browser ( >>>>> changing View -> Encoding ) and with >>>>> InputStreamReader(connection.getInputStream(),"iso-8859-1")); >>>>> >>>>> For example: >>>>> >>>>> CODE:200 >>>>> HEADER:{[HTTP/1.1 200 OK], Date=[Fri, 14 Mar 2014 12:26:13 GMT], >>>>> Transfer-Encoding=[chunked], >>>>> Content-Type=[application/json;charset=iso-8859-1], >>>>> Server=[Apache-Coyote/1.1]} >>>>> Detected encoding = UTF-8 >>>>> >>>>> Why is not encoding in iso-8859-1 ? >>>>> >>>>> Regards >>>>> >>>> >>> >>> >>> -- >>> Sergey Beryozkin >>> >>> Talend Community Coders >>> http://coders.talend.com/ >>> >>> Blog: http://sberyozkin.blogspot.com > > > > -- > Sergey Beryozkin > > Talend Community Coders > http://coders.talend.com/ > > Blog: http://sberyozkin.blogspot.com
