xml - Specific characters not rendering properly in Java -


I have a problem when displaying a wire from a server in a JTable, with some specific character "é" or "A" Instead of appear as small white intersections. I tried a lot of things but none of them fixed my problem. I am working with Eclipse under Windows Server was developed using Visual Studio 2010. The server sends an XML file using tinyXML2, the customer uses JDom to read it. The font used is "Dialog", the server takes the string from the Oracle database.

I think this is an encoding problem, but I am unable to fix it yet.

Is anyone's idea?

Arx

Edit: According to the request, how do I use JDO

  XML (Element E) {Player's result = new player (); String e_text = null; Try {e_text = e.getChildText (XMLTags.XML_Player_playerId); If (e_text! = Null) result.setID (integer. ParseInt (e_text)); E_text = e.getChildText (XMLTags.XML_Player_lastName); If (e_text! = Null) result.setName (e_text); E_text = e.getChildText (XMLTags.XML_Player_point_scored); If (e_text! = Null) results Extra (STAT_SCORED, double. E_text); E_text = e.getChildText (XMLTags.XML_Player_point_scored_last); If (e_text! = Null) results Extra (STAT_SCORED_LAST, double. E_text); } Hold (Exception pre) {ex.printStackTrace (); } Return results; } Public Static Document Load (String Filename) {File XMLFile = New File (CLIENT_TO_SERVER, Filename); SAXbuilder sxb = new SAXBuilder (); Document document = new document (); Try {document = sxb.build (new file (XMLFile.getPath ())); } Hold (exception e) {e.printStackTrace ();} return document; }  

Read the file using the correct encoding, something like this:

document = sxb.build (new inputstreamreader (new input streamer (new file inputstream (XMLFile.getPath ()), "UTF8")));

Note: 1. First determine that that file. Specify that charset in place of the UTF8 above

  1. incase encoding is not known or is being generated from various systems with different encodings, you can use 'Mozilla's Encoding Detector Library' Can be used. @see

  2. Unsmitted encoding exceptions must be handled


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -