Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Commit

Permalink
Change encoding to utf-8-sig
Browse files Browse the repository at this point in the history
  • Loading branch information
vegitron committed Jan 27, 2017
1 parent f20d210 commit 3e947c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sqlshare_rest/test/api/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def test_download(self):
self.assertEquals(response["Content-Disposition"], 'attachment; filename="ds13.csv"')
self.assertEquals(response["Content-Type"], 'text/csv')

data = StringIO("".join(map(lambda x: x.decode("utf-8"), response.streaming_content)))
data = StringIO("".join(map(lambda x: x.decode("utf-8-sig"), response.streaming_content)))
reader = csv.reader(data, delimiter=",")
values = []
for row in reader:
Expand Down
2 changes: 1 addition & 1 deletion sqlshare_rest/test/api/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_download(self):
self.assertEqual(response2.status_code, 200)
self.assertTrue(response2.streaming)

response_body = StringIO("".join(map(lambda x: x.decode("utf-8"), response2.streaming_content))).read()
response_body = StringIO("".join(map(lambda x: x.decode("utf-8-sig"), response2.streaming_content))).read()

if is_mssql():
resp = '""\n"1"\n'
Expand Down
4 changes: 2 additions & 2 deletions sqlshare_rest/test/api/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_running(self):
response = self.client.post(url, { "sql": "SELECT (1), (2)" }, **auth_headers)
self.assertEquals(response.status_code, 200)

data = StringIO("".join(map(lambda x: x.decode("utf-8"), response.streaming_content)))
data = StringIO("".join(map(lambda x: x.decode("utf-8-sig"), response.streaming_content)))
reader = csv.reader(data, delimiter=",")
values = []
for row in reader:
Expand All @@ -78,7 +78,7 @@ def test_running(self):
response = self.client.post(url, { "sql": "SELECT ('\",;\na')" }, **auth_headers)
self.assertEquals(response.status_code, 200)

data = StringIO("".join(map(lambda x: x.decode("utf-8"), response.streaming_content)))
data = StringIO("".join(map(lambda x: x.decode("utf-8-sig"), response.streaming_content)))
reader = csv.reader(data, delimiter=",")
values = []
for row in reader:
Expand Down

0 comments on commit 3e947c6

Please sign in to comment.