stark9000
stark9000

Reputation: 71

java swing jtextfiled unicode sinhala

***************************UPDATED*********************************************************************** i have found a similar question :

here : same question by another user

this one is with little details , but i still cant get it to work !

any help would be glad fully accepted !


I want to type Sinhalese words in (J2SE)swing textfileds , but they don't appear correctly in Java , same text in notepad shows correct word. how can i fix this ?

notepad picture: http://imageupper.com/i/?S0200010080011O13734602521426968

java picture : http://imageupper.com/i/?A0300010070011I13734604591427932

Upvotes: 1

Views: 1068

Answers (2)

Isuru Ranawaka
Isuru Ranawaka

Reputation: 105

Edit: That other user with the same question that you have mentioned is me. :)

As I found out, the char data type is not enough to render letters like "ශ්‍ර" because it needs 3 8bit characters. And the Java language isn't going to change the size of char data type just because we Sri Lankans want to render our characters. I had the similar question previously and I am the user you mentioned in your question.

"ශ්‍ ර" is shown with 2 8bit characters for each character and that's all we got till now. You might want to checout SWT because it shows characters pretty damn well in my experience.

Upvotes: 1

nachokk
nachokk

Reputation: 14413

The same letters are in both images, so it's not problem of encoding.

The problem is that you have to set a proper font to the textfield. You can create the font if you don't have it, check this setting custom font @AndrewThompson answer :)

Upvotes: 1

Related Questions