jenkins-bot has submitted this change and it was merged.

Change subject: Add UTF-16 CSV output option
......................................................................


Add UTF-16 CSV output option

Bug: T76126
Change-Id: I60ef05329c314d749d6171a60ea62304c0df3a0e
---
M quarry/web/app.py
M quarry/web/static/templates/query-resultset.html
2 files changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/quarry/web/app.py b/quarry/web/app.py
index 9830f56..28f82c5 100644
--- a/quarry/web/app.py
+++ b/quarry/web/app.py
@@ -352,6 +352,7 @@
     qrun = g.conn.session.query(QueryRun).get(qrun_id)
     reader = SQLiteResultReader(qrun, app.config['OUTPUT_PATH_TEMPLATE'])
     response = output.get_formatted_response(format, qrun, reader, 
resultset_id)
+    response.encoding = request.args.get('encoding', 'utf-8')
     if request.args.get('download', 'false') == 'true':
         # Download this!
         if qrun.rev.query.title:
diff --git a/quarry/web/static/templates/query-resultset.html 
b/quarry/web/static/templates/query-resultset.html
index 1f0bd5e..57ceb7a 100644
--- a/quarry/web/static/templates/query-resultset.html
+++ b/quarry/web/static/templates/query-resultset.html
@@ -17,6 +17,7 @@
                     <li><a 
href="/run/{{run_id}}/output/{{resultset_id}}/tsv?download=true">TSV</a></li>
                     <li><a 
href="/run/{{run_id}}/output/{{resultset_id}}/json?download=true">JSON</a></li>
                     <li><a 
href="/run/{{run_id}}/output/{{resultset_id}}/csv?download=true">CSV</a></li>
+                    <li><a 
href="/run/{{run_id}}/output/{{resultset_id}}/csv?download=true&encoding=utf-16">Excel
 (UTF-16 CSV)</a></li>
                 </ul>
             </div>
         </div>

-- 
To view, visit https://gerrit.wikimedia.org/r/217962
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I60ef05329c314d749d6171a60ea62304c0df3a0e
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to