Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding errors #125

Merged
merged 1 commit into from
Feb 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osm2gtfs/creators/routes_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _define_long_name(self, route):
Returns the long name for the use in the GTFS feed.
Can be easily overridden in any creator.
"""
return route.name
return route.name.encode('utf-8')

def _define_route_type(self, route):
"""
Expand Down
5 changes: 2 additions & 3 deletions osm2gtfs/creators/trips_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def add_trips_to_feed(self, feed, data):
# Go though all lines
for line_id, line in data.routes.iteritems():

print("\nGenerating schedule for line: [" + str(
line_id) + "] - " + line.name)
print("\nGenerating schedule for line: [" + line_id + "] - " + line.name)

# Loop through it's itineraries
itineraries = line.get_itineraries()
Expand All @@ -62,7 +61,7 @@ def add_trips_to_feed(self, feed, data):
feed, itinerary, line, trip_builder, shape_id)

# Print out status messge about added trips
print(" Itinerary: [" + str(itinerary.route_id) + "] " +
print(" Itinerary: [" + itinerary.route_id.encode("utf-8") + "] " +
itinerary.to.encode("utf-8") + " (added " + str(
trips_count) + " trips, serving " + str(
len(itinerary.get_stops())) + " stops) - " +
Expand Down