mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 17:10:30 +00:00
fixed umlaut problem with Brandenburg auto-complete
This commit is contained in:
parent
209bb2b1e3
commit
b389b13fac
3 changed files with 16 additions and 2 deletions
|
@ -188,7 +188,7 @@ public class VbbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||||
{
|
{
|
||||||
final String uri = String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), ISO_8859_1));
|
final String uri = String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), UTF_8));
|
||||||
|
|
||||||
return jsonGetStops(uri);
|
return jsonGetStops(uri);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import static junit.framework.Assert.assertEquals;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.schildbach.pte.BvgProvider;
|
import de.schildbach.pte.BvgProvider;
|
||||||
|
@ -80,6 +81,16 @@ public class BvgProviderLiveTest extends AbstractProviderLiveTest
|
||||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, resultPlan.status);
|
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, resultPlan.status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void autocompleteUmlaut() throws Exception
|
||||||
|
{
|
||||||
|
final List<Location> autocompletes = provider.autocompleteStations("Güntzelstr.");
|
||||||
|
|
||||||
|
print(autocompletes);
|
||||||
|
|
||||||
|
Assert.assertEquals("Güntzelstr. (U)", autocompletes.get(0).name);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autocompleteIncomplete() throws Exception
|
public void autocompleteIncomplete() throws Exception
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,7 @@ package de.schildbach.pte.live;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.schildbach.pte.NetworkProvider.Accessibility;
|
import de.schildbach.pte.NetworkProvider.Accessibility;
|
||||||
|
@ -68,9 +69,11 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void autocompleteUmlaut() throws Exception
|
public void autocompleteUmlaut() throws Exception
|
||||||
{
|
{
|
||||||
final List<Location> autocompletes = provider.autocompleteStations("Hedwigshöhe");
|
final List<Location> autocompletes = provider.autocompleteStations("Güntzelstr.");
|
||||||
|
|
||||||
print(autocompletes);
|
print(autocompletes);
|
||||||
|
|
||||||
|
Assert.assertEquals("Güntzelstr. (U)", autocompletes.get(0).name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue