We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

Japanese

krakatoa
krakatoa asked
on
41 Views
Last Modified: 2021-03-23
I'm intrigued to discover what I' not doing right with this piece of code :

Font font = new Font("x-JIS0208"/*"Cp930"*/, Font.PLAIN, 12);
    
    String sti = new String("We would like this to appear in Japanese");
    
    
    jta.setFont(font);
    
    
    Locale loc = new Locale("ja","JP");
    Locale.setDefault(loc);
    
    
    StringCharacterIterator sci = new StringCharacterIterator((loc.getDisplayLanguage()).toString());
    
    while(!(sci.current() == sci.DONE)){jta.append(new String()+sci.current());sci.next();}
    
    
    sci.setText(sti);
    while(!(sci.current()==sci.DONE)){jta.append(new String()+sci.current());sci.next();}
 ... that the JTextArea (jta) displays Japanese characters for the display language, but doesn't render the 'sti' String in terms of the same characters. Having never been on this ground before, I'm stumped. ;)
Comment
Watch Question
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 21 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE