Need to send requests with the UTF-8 character set, not the StringBody default of ASCII

pull/14/head
Sam Bosley 12 years ago
parent 7839e67f1f
commit f6f0e5b64f

@ -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);

Loading…
Cancel
Save