Reputation: 10953
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
Reputation: 1037
I do it this way:
InputStreamReader is = new InputStreamReader(new FileInputStream("name.xml"), "UTF-8");
digester.parse(is);
Upvotes: 1
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