diff --git a/enabler/src/de/schildbach/pte/VrnProvider.java b/enabler/src/de/schildbach/pte/VrnProvider.java index fcf8845c..ecee886f 100644 --- a/enabler/src/de/schildbach/pte/VrnProvider.java +++ b/enabler/src/de/schildbach/pte/VrnProvider.java @@ -19,6 +19,8 @@ package de.schildbach.pte; import javax.annotation.Nullable; +import com.google.common.base.Charsets; + import de.schildbach.pte.dto.Line; import de.schildbach.pte.dto.Product; @@ -27,13 +29,16 @@ import de.schildbach.pte.dto.Product; */ public class VrnProvider extends AbstractEfaProvider { - private static final String API_BASE = "http://fahrplanauskunft.vrn.de/vrn_mobile/"; + private static final String API_BASE = "http://fahrplanauskunft.vrn.de/vrn/"; + // http://fahrplanauskunft.vrn.de/vrn_mobile/ // http://efa9.vrn.de/vrt/ public VrnProvider() { super(NetworkId.VRN, API_BASE); + + setRequestUrlEncoding(Charsets.UTF_8); } @Override diff --git a/enabler/test/de/schildbach/pte/live/VrnProviderLiveTest.java b/enabler/test/de/schildbach/pte/live/VrnProviderLiveTest.java index 47af59f5..1a2c5bcc 100644 --- a/enabler/test/de/schildbach/pte/live/VrnProviderLiveTest.java +++ b/enabler/test/de/schildbach/pte/live/VrnProviderLiveTest.java @@ -17,7 +17,9 @@ package de.schildbach.pte.live; +import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.util.Date; @@ -85,7 +87,8 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest @Test public void suggestLocationsWithUmlaut() throws Exception { - final SuggestLocationsResult result = suggestLocations("grün"); + final SuggestLocationsResult result = suggestLocations("Käfertal"); + assertThat(result.getLocations(), hasItem(new Location(LocationType.STATION, "6005547"))); print(result); } @@ -166,4 +169,15 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest final QueryTripsResult earlierResult = queryMoreTrips(later2Result.context, false); print(earlierResult); } + + @Test + public void tripWithUmlaut() throws Exception + { + final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, null, null, "Käfertal"), null, new Location(LocationType.STATION, + "6002417", "Mannheim", "Hauptbahnhof"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL); + print(result); + assertEquals(QueryTripsResult.Status.OK, result.status); + assertTrue(result.trips.size() > 0); + assertEquals(result.trips.get(0).from, new Location(LocationType.STATION, "6005547")); + } }