Changeset 31849 in osm for applications/editors/josm/plugins/wikipedia
- Timestamp:
- 2015-12-22T18:51:39+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r31848 r31849 80 80 + "?lang=" + wikipediaLang 81 81 + "&depth=" + depth 82 + "&cat=" + encodeURL(category);82 + "&cat=" + Utils.encodeUrl(category); 83 83 Main.info("Wikipedia: GET " + url); 84 84 try (final InputStream in = Utils.openURL(new URL(url)); … … 123 123 124 124 try (final OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8")) { 125 out.write("articles=" + encodeURL(Utils.join(",", articleNames)));125 out.write("articles=" + Utils.encodeUrl(Utils.join(",", articleNames))); 126 126 } 127 127 … … 304 304 final String url = "https://tools.wmflabs.org/wiwosm/osmjson/getGeoJSON.php?action=check" 305 305 + "&lang=" + wikipediaLang 306 + "&article=" + encodeURL(wikipediaArticle);306 + "&article=" + Utils.encodeUrl(wikipediaArticle); 307 307 Main.info("Wikipedia: GET " + url); 308 308 try (final InputStream in = Utils.openURL(new URL(url)); … … 325 325 public String getBrowserUrl() { 326 326 return "https://" + wikipediaLang + ".wikipedia.org/wiki/" 327 + encodeURL(wikipediaArticle.replace(" ", "_"));327 + Utils.encodeUrl(wikipediaArticle.replace(" ", "_")); 328 328 } 329 329 … … 347 347 } 348 348 349 public static String encodeURL(String url) {350 try {351 return URLEncoder.encode(url, "UTF-8");352 } catch (UnsupportedEncodingException ex) {353 throw new IllegalStateException(ex);354 }355 }356 357 349 public static <T> List<List<T>> partitionList(final List<T> list, final int size) { 358 350 return new AbstractList<List<T>>() {
Note:
See TracChangeset
for help on using the changeset viewer.