Overriding Content-Type as
req.setRequestHeader("Content-Type", "text/plain; charset='some-encoding'");
makes the sent string be encoded as "some-encoding" in WebKit, but not in MSIE or Firefox, where it's always sent as UTF-8. The XMLHttpRequest spec draft mandates IE/Firefox behavior, of course.
Additionally, looking at Content-Type further complicates the choice of encoding for documents, see bug 11695.
Created attachment 12298 [details]
Comment on attachment 12298 [details]
Committed revision 18675.