From 9f4cf56255a7cdecd4d229c563211755445572a4 Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Tue, 14 Nov 2017 20:34:46 +0100 Subject: [PATCH] Perhaps fixes ##370 as it forces the Deluge POST request to be encoded as UTF-8. --- .../main/java/org/transdroid/daemon/Deluge/DelugeAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/transdroid/daemon/Deluge/DelugeAdapter.java b/app/src/main/java/org/transdroid/daemon/Deluge/DelugeAdapter.java index da39ecf5..0f2d3bb7 100644 --- a/app/src/main/java/org/transdroid/daemon/Deluge/DelugeAdapter.java +++ b/app/src/main/java/org/transdroid/daemon/Deluge/DelugeAdapter.java @@ -28,6 +28,7 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.cookie.Cookie; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.protocol.HTTP; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -555,7 +556,7 @@ public class DelugeAdapter implements IDaemonAdapter { // Set POST URL and data HttpPost httppost = new HttpPost(buildWebUIUrl() + PATH_TO_RPC); httppost.setHeader("content-type", "application/json"); - StringEntity se = new StringEntity(data.toString()); + StringEntity se = new StringEntity(data.toString(), HTTP.UTF_8); httppost.setEntity(se); // Set session cookie, if it was not in the httpclient object yet