From f6f0e5b64f905df6792eddd5d82af877ee5ee54e Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 12 Apr 2013 13:59:47 -0700 Subject: [PATCH] Need to send requests with the UTF-8 character set, not the StringBody default of ASCII --- .../com/todoroo/astrid/actfm/sync/ActFmInvoker.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java index 92602526d..2bb744451 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmInvoker.java @@ -8,6 +8,7 @@ package com.todoroo.astrid.actfm.sync; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.nio.charset.Charset; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; @@ -203,8 +204,15 @@ public class ActFmInvoker { String request = createFetchUrl("api/" + API_VERSION, "synchronize", params); if (SYNC_DEBUG) Log.e("act-fm-post", request); + Charset chars; + try { + chars = Charset.forName("UTF-8"); + } catch (Exception e) { + chars = null; + } + entity.addPart("token", new StringBody(tok)); - entity.addPart("data", new StringBody(data)); + entity.addPart("data", new StringBody(data, chars)); entity.addPart("time", new StringBody(timeString)); String response = restClient.post(request, entity);