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 8132285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:18:41+00:00 2026-06-06T09:18:41+00:00

i want to send arabic data from servlet using HTTPServletResponse to client i am

  • 0

i want to send arabic data from servlet using HTTPServletResponse to client

i am trying this

response.setCharacterEncoding("UTF-8");
response.setHeader("Info", arabicWord);

and i receive the word like this

String arabicWord = response.getHeader("Info");

in client(receiving) also tried this

byte[]d = response.getHeader("Info").getBytes("UTF-8");
arabicWord = new String(d);

but seems like there is no unicode because i receive strange english words,so please how can i send and receive arabic utf8 words?

  • 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-06-06T09:18:42+00:00Added an answer on June 6, 2026 at 9:18 am

    HTTP headers doesn’t support UTF-8. They officially support ISO-8859-1 only. See also RFC 2616 section 2:

    Words of *TEXT MAY contain characters from character sets other than ISO- 8859-1 [22] only when encoded according to the rules of RFC 2047 [14].

    Your best bet is to URL-encode and decode them.

    response.setHeader("Info", URLEncoder.encode(arabicWord, "UTF-8"));
    

    and

    String arabicWord = URLDecoder.decode(response.getHeader("Info"), "UTF-8");
    

    URL-encoding will transform them into %nn format which is perfectly valid ISO-8859-1. Note that the data sent in the headers may have size limitations. Rather send it in the response body instead, in plain text, JSON, CSV or XML format. Using custom HTTP headers this way is namely a design smell.

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

Sidebar

Related Questions

I want send some data to a remote webpage from my site. Actually it
I want to send a UIImage to a server with socket. I'm using this
I am developing mobile web page. I want send from this page request to
I want to send a large amount of data to a server using NSURLConnection
Hello Sir i want send list of data to php server i use following
Want to send the text from my current vb application to the Active Window
I want to send SMS using LWUIT. what class should i be looking at?
I want send an image from my App to web service, to do it,
How can I send array to stored procedure? I want send it from JS
I want to send a couple of values to a web server from my

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.