Jericho
Jericho

Reputation: 10953

Java Digester for UTF-8

how to set encoding type of digester in java.Please help

because I have set the encoding type in xml while parsing using digester finally it gives string something like bytes(grnlநீ00) instead of UTF-8 string.

Is there any possibility to set Encoding type in parser like this ?

digester.addBeanPropertySetter("ECnetGRN/TRANSDATE", "transdate" );--set UTF-8

Upvotes: 0

Views: 322

Answers (2)

SzB
SzB

Reputation: 1037

I do it this way:

InputStreamReader is = new InputStreamReader(new FileInputStream("name.xml"), "UTF-8");
digester.parse(is);

Upvotes: 1

Alankar Srivastava
Alankar Srivastava

Reputation: 864

I guess you can set encoding to the input stream (xml input) which is passed to digester and it will be taken care.

Upvotes: 0

Related Questions