Fixed csv charset master
authorJean-Michel Nirgal Vourgère <jmv_deb@nirgal.com>
Mon, 29 Jan 2018 17:09:12 +0000 (18:09 +0100)
committerJean-Michel Nirgal Vourgère <jmv_deb@nirgal.com>
Mon, 29 Jan 2018 17:09:12 +0000 (18:09 +0100)
go.py

diff --git a/go.py b/go.py
index 7efcdcd41b96283cfa89ff71fdefe1f3e0105428..3ee442ed7f2f1468de431f08c01482462bd6b4d5 100755 (executable)
--- a/go.py
+++ b/go.py
@@ -131,8 +131,8 @@ def download():
 
         httpresponse = httpopen(BASE_URL + '/templates/account/accountActivityListDownload.cfm?AccNum='+cptnum+'&viewMode=CSV&orderBy=TRANSACTION_DATE_DESCENDING&page=1&startDate='+startdate+'&endDate='+enddate+'&startAmount=0&endAmount=999999999999&initialPaginationLoad=true&screenSize=big&showBalance=true')
         # httpresponse = httpopen(BASE_URL + '/templates/account/accountActivityListDownload.cfm?AccNum='+cptnum+'&viewMode=CSV&orderBy=TRANSACTION_DATE_DESCENDING&page=1&startDate='+startdate+'&endDate='+enddate+'&startAmount=0&endAmount=999999999999&initialPaginationLoad=true&screenSize=big&showBalance=true&hiddenFormId=00000000-0000-0000-0000-000000000000')  # hiddenFormId is javascript created random UUID
-        # logging.debug(httpresponse.info())
-        csvdata = httpresponse.read().decode('utf-8')
+        #logging.debug(httpresponse.info()) # Reports Content-Type: application/csv;charset=windows-1252
+        csvdata = httpresponse.read().decode('windows-1252')
         if len(csvdata) == 0:
             logging.info('No mouvement for %s', title)
             continue