diff --git a/GO_Sync/src/main/java/edu/usf/cutr/go_sync/io/GTFSReadIn.java b/GO_Sync/src/main/java/edu/usf/cutr/go_sync/io/GTFSReadIn.java index 2eda90f1..73b9d90a 100644 --- a/GO_Sync/src/main/java/edu/usf/cutr/go_sync/io/GTFSReadIn.java +++ b/GO_Sync/src/main/java/edu/usf/cutr/go_sync/io/GTFSReadIn.java @@ -38,6 +38,7 @@ public class GTFSReadIn { private List stops; private final String ROUTE_KEY = "route_ref"; private final String NTD_ID_KEY = "ntd_id"; + private static final String UTF8_BOM = "\uFEFF"; private static Hashtable allRoutes; //TODO read agency.txt @@ -136,6 +137,9 @@ public List readBusStop(String fName, String agencyName, String routes_fNa { if (isFirstLine) { isFirstLine = false; + if (thisLine.startsWith(UTF8_BOM)) { + thisLine = thisLine.substring(1); + } OperatorInfo.setGtfsFields(thisLine); thisLine = thisLine.replace("\"", ""); String[] keys = thisLine.split(","); @@ -250,6 +254,9 @@ public Hashtable readRoutes(String routes_fName){ while ((thisLine = br.readLine()) != null) { if (isFirstLine) { isFirstLine = false; + if (thisLine.startsWith(UTF8_BOM)) { + thisLine = thisLine.substring(1); + } thisLine = thisLine.replace("\"", ""); String[] keys = thisLine.split(","); for(int i=0; i> matchRouteToStop(String routes_fName, S while ((thisLine = br.readLine()) != null) { if (isFirstLine) { isFirstLine = false; + if (thisLine.startsWith(UTF8_BOM)) { + thisLine = thisLine.substring(1); + } thisLine = thisLine.replace("\"", ""); String[] keys = thisLine.split(","); for(int i=0; i> matchRouteToStop(String routes_fName, S while ((thisLine = br.readLine()) != null) { if (isFirstLine) { isFirstLine = false; + if (thisLine.startsWith(UTF8_BOM)) { + thisLine = thisLine.substring(1); + } thisLine = thisLine.replace("\"", ""); String[] keys = thisLine.split(","); for(int i=0; i(); // readBusStop("C:\\Users\\Khoa Tran\\Desktop\\Summer REU\\Khoa_transit\\stops.txt"); } -} \ No newline at end of file +}