Take the 2-minute tour ×

I recently changed my c2dm push aaplucation to GCM. A new problem appeared. Its now receiving '?' instead of 'ö','ï', ...

My server logs correct Strings, but the application receives '?' insteads.

Do you think it could have something to do with GCM?

My code is the following:

public static void displayMessage(Context context, Intent intent) {
    Bundle extras = intent.getExtras();
    if (extras != null) {
        String message = (String) extras.get("message");
        Log.v("extras", extras.toString());
        Util.generateNotification(context, message, intent);

and the log is then:

10-02 22:18:23.671: V/intent(29809): Bundle[{message={"name":"j?rg"},
message_id=8bb60eee-3a93-4075-b606-40495511a4da, collapse_key=do_not_collapse, from=160085429222}]

Best regards!

share|improve this question
I could use an URLEncoder/Decoder... Is there another way? –  user1667910 Oct 3 '12 at 12:34
Make sure it's not an artifact of the logging. –  Seva Alekseyev Oct 5 '12 at 2:24
I'm sure. The special/Latin1 characters are simply replaced by '?'. It worked perfectly with c2dm. –  user1667910 Oct 5 '12 at 5:55

1 Answer 1

up vote 1 down vote accepted

I dont think so there is problem in GCM. Try to use UTFEncoding for your message.

String output = new String(name.getBytes("8859_1"), "utf-8");
share|improve this answer
Converting to UTF-8 does not work. This could be the same problem: stackoverflow.com/questions/11501504/… –  user1667910 Oct 3 '12 at 11:38
The only way that worked for me, thanks! –  Roman Jun 5 '13 at 16:37

Your Answer


