Skip to content

Commit

Permalink
Encode in open
Browse files Browse the repository at this point in the history
  • Loading branch information
whatnick authored Oct 4, 2017
1 parent e8ea3ba commit 20dc024
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/usage_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ You can create a KML object by reading a KML file as a string
# Start by importing the kml module
>>> from fastkml import kml
#Read file into string and convert to UTF-8
>>> with open(kml_file, 'r') as myfile:
... data=myfile.read().replace('\n', '')
>>> doc = data.encode('utf-8')
#Read file into string and convert to UTF-8 (Python3 style)
>>> with open(kml_file, 'rt', encoding="utf-8") as myfile:
... doc=myfile.read()
# OR
Expand Down

0 comments on commit 20dc024

Please sign in to comment.