kaju74
266
3
General

How to response an unicode json?

Posted 4 years ago by kaju74

Hi.

I'm trying to return a json response with german umlaut back to an 'ajax'-driven javascript like this:

        return Response::json(array(
            'message' => 'Vielen Dank.'
        ), 200);

My javascript part is:

// on validation success
request.done(function (data) {
    // debug output
    alert(data.toSource());
});

This works fine until I return a german umlaut like:

        return Response::json(array(
            'message' => 'Vielen Dank. Sie hören von uns!'
        ), 200);

This time, the 'done' method and the alert won't be called.

Any idea, why?

Thank you, kaju

Please sign in or create an account to participate in this conversation.