Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1046963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:13:47+00:00 2026-05-16T16:13:47+00:00

I want to send a response to a get request made by the javascript

  • 0

I want to send a response to a get request made by the javascript object ‘XMLHTTPRequest.’

The response content-type will be ‘text/plain’.

I would like to add a ‘charset’ to that (i.e. ‘Content-Type:text/plain;charset=UTF-8’)

What encodings does javascript work with natively and what encodings will work with javascript on all browsers?

I did find the following site which makes me think that UTF-8 encoding is a safe bet:

http://jerakeen.org/test/unicode/?charset=iso-8859-1

Any other thoughts on this subject? (The server side technology is .NET.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:13:48+00:00Added an answer on May 16, 2026 at 4:13 pm

    Yes, your reply can specify that it is encoded in UTF-8. And it’s an excellent choice, too.

    All the modern browsers understand UTF-8 natively. And it is preferred over 8859-1 (which is so last-century).

    Main thing to watch out for: what is the original html page encoded in? (The page that is sending the XMLHTTPRequest?) Best would be for that page to also be encoded in UTF-8.

    If it is something else, then I’m not sure that everything will magically work. I would test in all the browsers if you’re not using UTF-8 consistently.

    Added:

    You can also look at the incoming Ajax request to your server. Its Accept-Charset heading should include utf-8. You can look at the Ajax request using Firebug’s “Net” tab or the Fiddler tool. If you’re controlling the originating page, then you’d just need to check the charset once in development.

    If some other groups in your org are creating pages which then call your Ajax server, you might want to bullet-proof your app by always checking the incoming Accept-Charset headings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send a HTTP request to http://YourWebSite.com/MessagefromMobiles.aspx and get the response. And
I want setup a http connection to send request and get the response in
I want to send request to j_security_check from servlet and get auth cookie from
I want to send a get request to twitter to return a large number
I want to send an ordinary get request which replaces the entire page just
I want to send a get request with a JSON body (for search) using
I have a list of person objects which I want to send in response
I have this form. Basically what I want is to send a auto-response with
I want send e-mail with some images in content. I think I must attached
Want to send the text from my current vb application to the Active Window

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.