Arockia Michel Prem
Arockia Michel Prem

Reputation: 29

Why is executing Java code unicode not displaying

I try to print the sign language Unicode character to Jframe label. it cannot support. I can do in VB .Net. i am using sign writing 2010 unicode font(https://github.com/Slevinski/signwriting_2010_fonts ). The example unicode is \u1D832

import java.awt.*;
import javax.swing.*;

public class TestUnicode extends JFrame {
  String RUPEE = "\u1D832";

  public TestUnicode() {
   setLayout(new FlowLayout());
   JLabel b = new JLabel("" + RUPEE);
   b.setFont(new Font("SignWriting 2010", Font.PLAIN, 250));
   add(b);
  }
public static void main(String args[])
{
    TestUnicode t= new TestUnicode();
        t.setVisible(true);
    t.setSize(300,300);
}
}

Upvotes: 1

Views: 97

Answers (1)

Andreas
Andreas

Reputation: 159096

\u1D832 means \u1D83 + '2'. Remember Java uses UTF-16 internally.

You can write it as follows, if you want to keep the 1D832 code point value.

String RUPEE = new String(Character.toChars(0x1D832));

Or you can write it as:

String RUPEE = "\uD836\uDC32"; // 1D832

Upvotes: 1

Related Questions