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

  • Home
  • SEARCH
  • 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 3974160
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:32:08+00:00 2026-05-20T04:32:08+00:00

In my java code,I am retrieving some multibyte data from database and making some

  • 0

In my java code,I am retrieving some multibyte data from database and making some xml DOM, with that data as the value of some node then converting the DOM to String and posting bytest to ASP Page via HTTPURLConnection , but somehow at receiver end the data is appearing as ???? instead of some multibyte values.Please suggest what to do.

Things that i am already doing..

1) I have set -Dfile.encoding =UTF8 as System Property
2)While using TransformerFactory for converting my XML DOM to String , i have set

 transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8")

to make sure that the encoding is proper there.
Please suggest where i am getting wrong.

@Jon Skeet Few more things to add here… 1) I am getting data from database correctly 2) Transformed XML also appears to be proper, as i checked by saving it to my local file system.
For posting earlier i was using something like

'dout = new DataOutputStream(urlconn.getOutputStream());'  
 'dout.write(strXML.getBytes());' 
 'dout.write(strXML);' 

and the resulting data at the receiver end was getting converted to ????? but then i switched to
‘

dout=new OutputStreamWriter(urlconn.getOutputStream(),"UTF8");' 
'dout.write(strXML);' 

then data at receiver end appears to be proper … but the problem occurs with the way it is handled at receiver end in this case. in my receiver ASP code i am using objStream.WriteLine (oXMLDom.xml)
… and here it fails and starts to give internal server error… please suggest whats wrong with second approach.

  • 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-20T04:32:09+00:00Added an answer on May 20, 2026 at 4:32 am

    There are lots of potential conversions going on there. You should verify the data at every step:

    • Check that you’re getting it out of the database correctly
    • See what the transformed XML looks like
    • Watch what goes over the network (including HTTP headers)
    • Check exactly what you’re getting in ASP

    Don’t just print out the strings as strings – log the Unicode value of each character, by casting it to int:

    for (int i = 0; i < text.length(); i++)
    {
        char c = text.charAt(i);
        log("Character " + c + " - " + (int) c);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Java code that uses curly braces in two ways // Curly
I'd like to write some (java) code that takes a PDF document, and creates
I'm having trouble retrieving data from my database using Spring Jdbc. Here's my issue:
Our Java code (not the test code) reads files from the current directory, which
I'm looking for Java code that can be used to generate sound at runtime
When indenting java code with annotations, vim insists on indenting like this: @Test public
I have this java code: <script src=http://www.google.com/jsapi></script> <script type=text/javascript> google.load(jquery, 1.2.6); $(a#more).click(function() { $(#info_box).show(blind,
Given the following Java code for generating a binary file: DataOutputStream out = new
When running the following Java code, I get very accurate and consistent results in
I'm looking around for a Java code signing certificate so my Java applets don't

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.