Note that there are some explanatory texts on larger screens.

plurals
  1. POApostrophe ( ' ) issue in SAX Parsing displaying strange square ( ⛦ ) character on TextView
    primarykey
    data
    text
    <p>I'm working on an app which is in the multilanguage. I'm getting the data in XML form. I used SAX parser for parsing xml files and display the data in the TextView. Everything is working fine even the special-characters display fine but the issue is only with apostrophe symbol.</p> <p>Also this ⛦ symbol is not showing in the XML file normally until when i view the view source of the XML file in Mozilla Firefox Browser.</p> <p>This is my XML which I got through the URL Link. This XML has utf-8 encoding.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;posts&gt; &lt;page id="001"&gt; &lt;title&gt;&lt;![CDATA[Mikes love for Chocolate shake is increasing day by day. ]]&gt;&lt;/title&gt; &lt;detial&gt;&lt;![CDATA[Durch enge Beziehungen mit unseren Lieferanten können wir attraktive rückläufig Preise und schnelle Lieferungen gewährleisten. Caroline Féry and Laura Herbst Universität Potsdam Mein Flugzeug hatte zwölf Stunden VERSPÄTUNG &lt;/p&gt;]]&gt;&lt;/detial&gt; &lt;/page&gt; &lt;/posts&gt; </code></pre> <p>I used SAX parser for parsing this XML:- (and displaying the parsed data in the TextView.)</p> <pre><code>public class GermanParseActivity extends Activity { /** Called when the activity is first created. */ static final String URL = "http://www.xyz.com/id=1"; ItemList itemList; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); XMLParser parser = new XMLParser(); String XML = parser.getXmlFromUrl(URL); String output = null; try { output = new String(XML.getBytes("8859_1"), "utf-8"); } catch (UnsupportedEncodingException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } System.out.println("This XML is ========&gt;"+XML); try { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); /** Create handler to handle XML Tags ( extends DefaultHandler ) */ MyXMLHandler myXMLHandler = new MyXMLHandler(); xr.setContentHandler(myXMLHandler); ByteArrayInputStream is = new ByteArrayInputStream(XML.getBytes()); xr.parse(new InputSource(is)); } catch(Exception e) { } itemList = MyXMLHandler.itemList; ArrayList&lt;String&gt; listItem= itemList.getTitle(); ListView lview = (ListView) findViewById(R.id.listview1); myAdapter adapter = new myAdapter(this, listItem); lview.setAdapter(adapter); } } </code></pre> <p>but after parsing I'm getting strange characters in place of apostrophe (') symbol</p> <p>Like these characters:</p> <p>Actual Sentence is :-</p> <blockquote> <p>Mikes’ love for Chocolate shake is increasing day by day.</p> </blockquote> <p>After Parsing Sentence is:-</p> <blockquote> <p>Mikes⛦ love for Chocolate shake is increasing day by day.</p> </blockquote> <p>Can anyone suggest me the way to overcome this issue of apostrophe (') symbol.</p> <p>Thanks in Advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload