豆瓣读书关键字怎么弄才支持中文搜索,在线等,求指导下,谢谢了。

https://api.douban.com/v2/book/search?q=十万个为什么

用上面这个api接口,q赋值为中文就搜索不到。怎么做才能支持中文搜索。我看有的人说需要urlencode。但是我不知道怎么做啊,求大神给个方法或者参考代码。谢谢了。

 public static String toURLEncoded(String paramString) {
        if (paramString == null || paramString.equals("")) {
            LogD("toURLEncoded error:"+paramString);
            return "";
        }

        try
        {
            String str = new String(paramString.getBytes(), "UTF-8");
            str = URLEncoder.encode(str, "UTF-8");
            return str;
        }
        catch (Exception localException)
        {
            LogE("toURLEncoded error:"+paramString, localException);
        }

        return "";
    }