Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8283019

JTextBox/JTextArea does not handle Hindi Characters properly in some cases

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      Tested in Windows-10 and MacOS 12.1.
      This bug seems to be appearing for all OSes(Windows/Linuix/Mac) for any Sanskrit-Derived-Languages like Hindi, Telugu, Kannada,etc

      A DESCRIPTION OF THE PROBLEM :
      JTextBox/JTextArea does not handle Hindi Characters properly in some cases. In correct case( as in Apple
       Notes, Safari URL text box), When using Devanagari-Keyboard(built in MacOS), if we wanted a character-combo like किम् one need to type following english-chars: 'kimf'

      But if we use any Java-GUI that is built using java.swing or java.awt apckages *TextBox/etc, we get following chars (for the same sequence 'kimf'): किम ्

      To get correct sequence, one needs to press backspace-key to get किम्


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Install & Devanagari-QWERTY keyboard in Mac
      Run any Java-GUI which has testbox/textarea
      Start typing chars: kimf , you should see किम् (for correct behaviour), for biggy case: you will see किम ्


      ACTUAL -
      किम ्

      ---------- BEGIN SOURCE ----------

      import javax.swing.*;
      public class Main {
          public static void main(String[] args) {
              JFrame f=new JFrame();//creating instance of JFrame
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JTextField b=new JTextField("click");
              b.setBounds(130,100,100, 40);

              f.add(b);

              f.setSize(400,500);
              f.setLayout(null);
              f.setVisible(true);

          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      To get correct sequence, one needs to press backspace-key to get किम्

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: