<p>In my web app, I submit some form fields with jQuery's <code>$.getJSON()</code> method. I am having some problems with the encoding. The character-set of my app is <code>charset=ISO-8859-1</code>, but I think these fields are submitted with <code>UTF-8</code>. </p>

<p>How I can set encoding used in <code>$.getJSON</code> calls? </p>

I think that you'll probably have to use
```
$.ajax()
```
if you want to change the encoding, see the
```
contentType
```
param below (the
```
success
```
and
```
error
```
callbacks assume you have
```
<div id="success"></div>
```
and
```
<div id="error"></div>
```
in the html):
```
```
$.ajax({
    type: "POST",
    url: "SomePage.aspx/GetSomeObjects",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    data: "{id: '" + someId + "'}",
    success: function(json) {
        $("#success").html("json.length=" + json.length);
        itemAddCallback(json);
    },
    error: function (xhr, textStatus, errorThrown) {
        $("#error").html(xhr.responseText);
    }
});
```
```
I actually just had to do this about an hour ago, what a coincidence!