Link to home
Start Free TrialLog in
Avatar of cubrovic
cubrovicFlag for Serbia

asked on

Accepting Unicode characters on forms

How can I accept unicode characters on form elements (JTextField...) and process it later as this
Avatar of Mick Barry
Mick Barry
Flag of Australia image

All Java strings are already Unicode.
Avatar of cubrovic

ASKER

Strings are Unicode but I can't accept it in JTextFields and other components.
When I insert some unicode characters  via keybord (or copy paste ) java converts it in the asci characters ??
Avatar of GrandSchtroumpf
GrandSchtroumpf

What JRE and OS do you use?
Win 2000 for jre i'm not quite sure now i think this is some  1.4.*
Maybe I miss to do something .
Maybe I have to use some of that InputLocale like objects when it is reading from users input;
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> java converts it in the asci characters ??

Set your locale appropriately, and install and use the relevant font.
Sorry for not participating for some time on this question but I was busy on some other stuff.
Anyway I still have a problem on accepting characters on my forms. Can you give me some (little) example in which you display TextFields with some foreign characters (serbian is what I need right now).
(I have proper fonts and in other programs (like internet explorer ) i change keyboard language to some other language and when i write foreign characters they are displayed properly.
Am i missing something java supposed to be easy for internationalization.
> I have proper fonts and in other programs (like internet explorer )

Java uses it's own set of fonts. To which a relevant font needs to be installed.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm going to close this question too and award points just one thing more on this.
Can I distribute font with my java apllication (to be sure that exists) and how can I do that?
I geuss you can but they will need to be installed as per above link.
Or I think you can use the createFont() method in Font to read the font file directly.