From 52ff4ecfd298f279475a4fbc1da95f0d1c16c2cc Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Mon, 24 Feb 2014 17:01:28 -0800 Subject: [PATCH] Fix to make emoji work in push groups. --- src/org/thoughtcrime/securesms/mms/TextSlide.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/mms/TextSlide.java b/src/org/thoughtcrime/securesms/mms/TextSlide.java index 3034d6690c..2f2fb1b484 100644 --- a/src/org/thoughtcrime/securesms/mms/TextSlide.java +++ b/src/org/thoughtcrime/securesms/mms/TextSlide.java @@ -79,8 +79,8 @@ public class TextSlide extends Slide { PduPart part = new PduPart(); try { - part.setData(message.getBytes(CharacterSets.MIMENAME_ISO_8859_1)); - + part.setData(message.getBytes(CharacterSets.MIMENAME_UTF_8)); + if (part.getData().length == 0) throw new AssertionError("Part data should not be zero!"); @@ -88,8 +88,8 @@ public class TextSlide extends Slide { Log.w("TextSlide", "ISO_8859_1 must be supported!", e); part.setData("Unsupported character set!".getBytes()); } - - part.setCharset(CharacterSets.ISO_8859_1); + + part.setCharset(CharacterSets.UTF_8); part.setContentType(ContentType.TEXT_PLAIN.getBytes()); part.setContentId((System.currentTimeMillis()+"").getBytes()); part.setName(("Text"+System.currentTimeMillis()).getBytes());