yes, it is a bug, though in CXF the default parameter is always UTF-8 so this typo is not exposed...

I'll get it fixed

Thanks, Sergey

On 25/04/14 13:21, Jose María Zaragoza wrote:
Hello:

I was looking HttpUtils source code and I saw a weird thing in the method:

  public static String getEncoding(MediaType mt, String defaultEncoding)
{

        String charset = mt == null ? "UTF-8" :
mt.getParameters().get("charset");

        return charset == null ? "UTF-8" : charset;

    }


What is defaultEncoding parameter for ?

I saw it because I use it in some own JSONProvider implementations.
IMHO, maybe it could be:

public static String getEncoding(MediaType mt, String defaultEncoding)
{
     String charset = mt == null ? defaultEncoding :
mt.getParameters().get("charset");
     return charset == null ? defaultEncoding : charset;
}

Regards


Reply via email to