On 10/19/2015 12:18 AM, Zheng Lin Edwin Yeo wrote: > I found that it works if I put the code in this way without the URLEncoder > > req.setParam("literal.title", filename); > > Is the URLEncoder doing the encoding from the chinese characters to the > string > of code like this "%E7%AB%8B%E9".?
Yes, that's what the URL encoder would do. SolrJ will automatically handle URL encoding of parameters. Because it is an API that takes Java code and generates HTTP requests, that's part of its job. If you URL encode it yourself, then SolrJ will URL encode it again when it sends it (turning the percent signs into %25), and Solr will receive things like the "%E7%AB%8B%E9" string you mentioned, not the original UTF-8 characters. Thanks, Shawn