html - how to get unicode text from jtextpane java -


i have set jtextpane content type html , setted

    ta_description = new jtextpane();     ta_description.setcontenttype("text/html");     ta_description.setfont(new font("latha", font.plain, 12));     ta_description.settext("<![cdata[<br>வேலூர் மாவட்டம், அணைக்கட்டு          தொகுதி பா.ம.க.வை சேர்ந்த கலையரசு எம்.எல்.ஏ. நேற்று முன்தினம்          காலை முதல்-அமைச்சர் ஜெயலலிதாவை சந்தித்து தனது தொகுதி          பிரச்சினைகள் குறித்து பேசினார். அதைத்தொடர்ந்து அவரை கட்சியில்          இருந்து நீக்குவதாக பா.ம.க. தலைவர் ஜி.கே.மணி அறிவித்தார்.<br>]]>); 

when text using ta_description.gettext() , below

<![cdata[<html> <head>

</head> <body> <br> &#2997;&#3015;&#2994;&#3010;&#2992;&#3021; &#2990;&#3006;&#2997;&#2975;&#3021;&#2975;&#2990;&#3021;, &#2949;&#2979;&#3016;&#2965;&#3021;&#2965;&#2975;&#3021;&#2975;&#3009; &#2980;&#3018;&#2965;&#3009;&#2980;&#3007; &#2986;&#3006;.&#2990;.&#2965;.&#2997;&#3016; &#2970;&#3015;&#2992;&#3021;&#2984;&#3021;&#2980; &#2965;&#2994;&#3016;&#2991;&#2992;&#2970;&#3009; &#2958;&#2990;&#3021;.&#2958;&#2994;&#3021;.&#2959;. &#2984;&#3015;&#2993;&#3021;&#2993;&#3009; &#2990;&#3009;&#2985;&#3021;&#2980;&#3007;&#2985;&#2990;&#3021; &#2965;&#3006;&#2994;&#3016; &#2990;&#3009;&#2980;&#2994;&#3021;-&#2949;&#2990;&#3016;&#2970;&#3021;&#2970;&#2992;&#3021; &#2972;&#3014;&#2991;&#2994;&#2994;&#3007;&#2980;&#3006;&#2997;&#3016; &#2970;&#2984;&#3021;&#2980;&#3007;&#2980;&#3021;&#2980;&#3009; &#2980;&#2985;&#2980;&#3009; &#2980;&#3018;&#2965;&#3009;&#2980;&#3007; &#2986;&#3007;&#2992;&#2970;&#3021;&#2970;&#3007;&#2985;&#3016;&#2965;&#2995;&#3021; &#2965;&#3009;&#2993;&#3007;&#2980;&#3021;&#2980;&#3009; &#2986;&#3015;&#2970;&#3007;&#2985;&#3006;&#2992;&#3021;. &#2949;&#2980;&#3016;&#2980;&#3021;&#2980;&#3018;&#2975;&#2992;&#3021;&#2984;&#3021;&#2980;&#3009; &#2949;&#2997;&#2992;&#3016; &#2965;&#2975;&#3021;&#2970;&#3007;&#2991;&#3007;&#2994;&#3021; &#2951;&#2992;&#3009;&#2984;&#3021;&#2980;&#3009; &#2984;&#3008;&#2965;&#3021;&#2965;&#3009;&#2997;&#2980;&#3006;&#2965; &#2986;&#3006;.&#2990;.&#2965;. &#2980;&#2994;&#3016;&#2997;&#2992;&#3021; &#2972;&#3007;.&#2965;&#3015;.&#2990;&#2979;&#3007; &#2949;&#2993;&#3007;&#2997;&#3007;&#2980;&#3021;&#2980;&#3006;&#2992;&#3021;.<br> </body> </html> ]]>

i saw tamil unicode characters http://www.utf.ru/tables/tamil.html

i need text correctly , dono how text properly.

java uses font system , if system doesn't contain specific font can deploy font within application using font.createfont(). if donot have tamil font download here

first thing have tamil unicode supported font. somthing this:

font tamil =new font("latha", font.bold,15);//i had font latha supports tamil font 

then set font of jtextpane :

ta_description.setfont(tamil); 

see how looks in system

full code:

import java.awt.borderlayout; import java.awt.eventqueue; import java.awt.font;  import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jtextpane; import javax.swing.border.emptyborder;  public class test extends jframe {      private jpanel contentpane;      /**      * launch application.      */     public static void main(string[] args) {         eventqueue.invokelater(new runnable() {             public void run() {                 try {                     test frame = new test();                     frame.setvisible(true);                 } catch (exception e) {                     e.printstacktrace();                 }             }         });     }      /**      * create frame.      */     public test() {         setdefaultcloseoperation(jframe.exit_on_close);         setbounds(100, 100, 450, 300);         contentpane = new jpanel();         contentpane.setborder(new emptyborder(5, 5, 5, 5));         contentpane.setlayout(new borderlayout(0, 0));         setcontentpane(contentpane);          jtextpane textpane = new jtextpane();         contentpane.add(textpane, borderlayout.center);         font tamilfont=new font("latha", font.bold,15);         textpane.setfont(tamilfont);        }  } 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -