Details
Description
org.apache.cxf.jaxrs.provider.FormEncodingProvider
public void writeTo(Object obj, Class<?> c, Type t, Annotation[] anns, MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException, WebApplicationException { // ....... else ..... MultivaluedMap<String, String> map = (MultivaluedMap<String, String>)obj; boolean encoded = AnnotationUtils.getAnnotation(anns, Encoded.class) != null; String encoding = HttpUtils.getSetEncoding(mt, headers, "UTF-8"); for (Iterator<Map.Entry<String, List<String>>> it = map.entrySet().iterator(); it.hasNext();) { Map.Entry<String, List<String>> entry = it.next(); for (Iterator<String> entryIterator = entry.getValue().iterator(); entryIterator.hasNext();) { String value = entryIterator.next(); os.write(entry.getKey().getBytes(encoding)); os.write('='); String data = encoded ? value : urlEncode(value); // <--- here urlEncode always use utf-8 , encoding get losted here os.write(data.getBytes(encoding)); if (entryIterator.hasNext() || it.hasNext()) { os.write('&'); } } }