When I set custom request headers for XMLHttprequest with setRequestHeader(), how will it be encoded? There must be some encoding, because JavaScript strings are utf-16, and I don't think each character is sent as 2 bytes to the server. HTTP specifies headers to be iso-8859-1 encoded. Are the headers encoded to iso-8850-1? Or are they sent as utf-8? http://www.w3.org/TR/XMLHttpRequest/ says nothing about it.