Skip to content

Commit

Permalink
Merge d41c42e into b1bd154
Browse files Browse the repository at this point in the history
  • Loading branch information
bennofs committed Sep 3, 2019
2 parents b1bd154 + d41c42e commit 30675c4
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -28,6 +28,9 @@
import org.wikidata.wdtk.rdf.PropertyRegister;
import org.wikidata.wdtk.rdf.RdfWriter;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public class StringValueConverter extends AbstractValueConverter<StringValue> {

public StringValueConverter(RdfWriter rdfWriter,
Expand Down Expand Up @@ -98,12 +101,12 @@ public Value getRdfValue(StringValue value,
*/
static String getCommonsFileUrl(String pageName) {
return "http://commons.wikimedia.org/wiki/File:"
+ pageName.replace(' ', '_');
+ URLEncoder.encode(pageName.replace(' ', '_'), StandardCharsets.UTF_8);
}

static String getCommonsDataUrl(String pageName) {
return "http://commons.wikimedia.org/data/main/"
+ pageName.replace(' ', '_');
+ URLEncoder.encode(pageName.replace(' ', '_'), StandardCharsets.UTF_8);
}

}

0 comments on commit 30675c4

Please sign in to comment.