[jdom-interest] How do I set encoding on blank document

Jason Hunter jhunter at servlets.com
Wed Aug 7 11:16:29 PDT 2002


I don't quite follow the example.

-jh-

mark at idrsolutions.com wrote:
> 
> I had some data I was storing as a String. I am now storing it by creating a
> blank document with
> 
> /////////////////////////////////////////////////////////////////
>     /**
>      * get data as an a blank list
>      */
>     public java.util.List getBlankTextList(){
> 
>       XMLTextData=new Document(new Element("Root"));
> 
> 
>       return XMLTextData.getRootElement().getChildren();
>     }
> 
> I then store the text as an attribute to an element.
> 
> When I extract the get with getAttributeValue later, those nasty 128-255
> characters have been remapped to \u20xx. Any ideas?
> 
> MArk
> On Wednesday 07 Aug 2002 5:00 pm, you wrote:
> > The encoding is set in the XMLOutputter.  So set it on the way out to
> > specify how you'd like it encoded as bytes.
> >
> > For reading data, it's returned as strings so there's no real need to
> > bother with encodings.  The builder should have decoded the chars
> > already.
> >
> > -jh-
> >
> > mark.stephens at ukonline.co.uk wrote:
> > > I am using jdom to create a blank document which I then add content to.
> > > How can I set the encoding which I want to be used?
> > >
> > > Alternatively, when I extract data by gettting a list of elements and
> > > then reading the attributes/values, how can I choose the encoding for
> > > this data (I want ISO8859, not UTF-8).
> > >
> > > Any advice, please?
> > >
> > > MArk
> > > _______________________________________________
> > > To control your jdom-interest membership:
> > > http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@your
> > >host.com



More information about the jdom-interest mailing list