Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Character sets and URL encoding

Status
Not open for further replies.

thrybergh

MIS
Feb 10, 2003
52
GB
Hello

I have a problem which I think is related to UTF-8 encoding and my browser (IE6).

I am outputting XML data via a Java servlet and transforming it with an XSLT stylesheet using Xalan. Do I need to use a call such as:

Code:
  baos.toString("UTF-8")

in my Java code to encode the XML data? Currently I do not, and it DISPLAYS correctly, but creates a link on the page with an invalid href since the characters are not coded correctly.

The link includes the name of an author ("Suárez") as a search parameter. The a should have a grave accent over it. It is displaying this correctly but when I hover over the link I see that it is encoded as a capital Ai with a tilde over the A. This then means the search for this author returns no results.

This is what I get:

This is what I want:


I have the encoding attribute set to "UTF-8" in my XSLT stylesheet.

(If I encode the bytes in the Java code with UTF-8 it displays a small square character instead of the "a" with a grave accent over it.)

Hopefully someone here can offer advice.

Thanks in advance.

[thumbsup2]
 
In the end, I used the "ISO-8859-1" charset instead of UTF-8, setting this in my XML and stylesheets.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top