?
Solved

Encoding problem - using JDOM with Xercer

Posted on 2001-07-19
9
Medium Priority
?
196 Views
Last Modified: 2012-08-14
I need an encoding of UTF-8 for my XML document. That is fine but I have all the input feed as ISO-8859-1. so basically I take the feed as

rs.getString(1).getBytes("ISO-8859-1");

Then when I put the data to the .xml file I really get what I want basically the right format as the input of the document.

So far so good...but this was on Windows2000 O/S. When I ported the same code to UNIX the problem was the same the encoding was not fine at all as per myoutput and got funny charcters in my XML file outputed.

Now I really am in a puzzle.

Any help will be great.

Thanx in advance.

dumdum
0
Comment
Question by:dumdum420
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 6301431
Why do you do 'rs.getString(1).getBytes("ISO-8859-1")'?

After rs.getString(1) statement your data is encoded as UNICODE. If you want get utf8 bytes and then pass it to output stream you must write
os.write(rs.getString(1).getBytes("UTF8"));
or if you use Xerces serializer you must setup the Output format object
  .... new OutputFormat(doc, "utf-8", true)...

0
 

Author Comment

by:dumdum420
ID: 6302496
No i want it in ISO-8859-1 when I get it from the database since I have some european charsets which can only be interpreted by this encoding. Then eventually my XMLOutputter is set to UTF-8. Just that the ISO-8859-1 is not working fine in UNIX O/S and is fine with WIN 2000.

Thanx in advance.
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6312735
Its probably something to do with the sun.io classes needed to translate between the internal Unicode/UTF-8 format and the platform. Which Unix OS are you using?
0
How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

 

Author Comment

by:dumdum420
ID: 6314483
I am using AIX 4.0 (IBM). Do you have any hint.

dumdum.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6790028
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

3.  Ask Community Support to help split points between participating experts.  Just comment here with details.

4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.

PLEASE DO NOT AWARD THE POINTS TO ME.
____________________________________________
---------->  Hi Experts:

In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.

------------->  The ALL TOPICS link has been updated today to reflect all the new TAs.

Thank you everyone.

Moondancer :)
Community Support Moderator @ Experts Exchange
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6946808
<review>

<recommendation>
PAQ question, refund points
</recommendation>

<objection>
any objection should be raised within 7 days
</objection>

<reviewer>
b1xml2
</reviewer>

</review>
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 6948125
Thanks, Brandon.
50 points refunded, this item moved to our PAQ at zero points today and closed.
Moondancer - EE Moderator
0
 

Author Comment

by:dumdum420
ID: 6949492
I was out of touch cause of some personal matters. Please tell me where can I be helpful or I was not doing the right thing.

Please do let me no.

Thanx to you all experts.

dumdum420
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6957935
Any questions asked here by you, dumdum420, need your ongoing involvement to respond to the Experts who help you with results.

This item has been closed at long last.

You have asked 33 questions here and only awarded/finalized 10 of them which is against our Guidelines.  I will be posting updates in them all to bring them to your attention.  In the meantime, click the link below which will let you see them all so you can begin the closing process on them.

http://www.experts-exchange.com/jsp/memberProfile.jsp?mbr=dumdum420&showQHistory=true


Moondancer - EE Moderator
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question