File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
metafacture-io/src/main/java/org/metafacture/io Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 3333import java .io .InputStreamReader ;
3434import java .io .Reader ;
3535import java .io .StringWriter ;
36+ import java .io .UnsupportedEncodingException ;
3637import java .net .HttpURLConnection ;
3738import java .net .URL ;
39+ import java .net .URLEncoder ;
40+ import java .nio .charset .StandardCharsets ;
3841import javax .xml .parsers .DocumentBuilder ;
3942import javax .xml .parsers .DocumentBuilderFactory ;
4043import javax .xml .parsers .ParserConfigurationException ;
@@ -109,7 +112,12 @@ public void setUserAgent(final String userAgent) {
109112 */
110113
111114 public void setQuery (final String query ) {
112- this .query = query ;
115+ try {
116+ this .query = URLEncoder .encode (query , StandardCharsets .UTF_8 .toString ());
117+ }
118+ catch (final UnsupportedEncodingException e ) {
119+ throw new MetafactureException (e );
120+ }
113121 }
114122
115123 /**
You can’t perform that action at this time.
0 commit comments