Skip to content

Commit

Permalink
Resolve issues with UnicodeEncodeError
Browse files Browse the repository at this point in the history
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 2: ordinal not in range(128)

This ensures we encode this with utf-8 so we don't run into errors.

Signed-off-by: Lance Albertson <[email protected]>
  • Loading branch information
ramereth committed Apr 22, 2024
1 parent d4b5a37 commit 969630c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion streamwebs_frontend/streamwebs/views/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ def export_cc(request, site_slug):
w = west.count('1')

writer.writerow([cc.school, cc.date_time, cc.site.site_name,
cc.weather, n, e, s, w, cc.est_canopy_cover])
cc.weather, n, e, s, w,
cc.est_canopy_cover.encode('utf-8')])

return response

Expand Down

0 comments on commit 969630c

Please sign in to comment.