Re: non-breakable space
Tatu Saloranta <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <[email protected]> |
--- On Wed, 12/3/08, Jabba Laci <[email protected]> wrote: > From: Jabba Laci <[email protected]> > Subject: Re: [jdom-interest] non-breakable space > To: "jdom interest" <[email protected]> > Date: Wednesday, December 3, 2008, 9:27 AM > Hi, > > I added the character '\u00A0' to the end of the string, but as a > result I get "Address: " instead of That's fine, there's nothing wrong in including character as is. HTML does not require escaping, it just allows it. However: > "Address: ". When I verify it in a browser, I have a funny character > ("Address:Â") at the place of the space. Sounds like you have incorrect encoding specified; such that content is in Latin1, but page claims to be UTF-8, or vice versa. Nbsp byte itself is expressed differently in different encodings: as a 2-byte sequence in UTF-8, as a single byte in Latin1. Alternatively, it is possible to make JDOM outputter escape all kinds of characters, for example anything outside of ascii range (char > 127). But you really should fix encoding problems for the page as that is one of most common problems with web page generation, and will eventually cause problems with other characters (accented ones etc). Hope this helps, -+ Tatu +- _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]