Special character coming parsing the xml

134 views Asked by At

When I am parsing xml, I am getting special in good dynamics application char like that

pic.png

but the actual text is like that "If you've got any question or need"

enter image description here

But when I am parsing same text in normal application its working fine.

I am using sharepoint server to get xml. Now I am using general encoding UTF-8 only.

For parsing I am using XMLpullparser.

So how to resolve special character from xml.

1

There are 1 answers

0
R. Zagórski On

There might be two things you might check:

  1. Persister class used to parse the .xml can be initialised with such constructor:

    Persister persister = new Persister(new Format(4, "<?xml version=\"1.0\" encoding= \"UTF-8\" ?>"));
    
  2. You might replace all such characters while parsing:

    value = value.replace("'", "\\'");