How do I correctly get the value of 'ⅻ' (and other similar non-alphabetical characters) and store it in a string?

Anya :

Given a character that is not a standard alphabet character, such as 'ⅻ', I'm having problems converting it to a string and retaining it's value. For example If I have:

String myStr = "ⅻⅾ℡ℬ";
Character myChar = myStr.charAt(0); 

Then System.out.println('ⅻ' == myChar); returns true, whereas System.out.println("ⅻ" == Character.toString(myChar)); returns false.

Thus my question effectively is how do I correctly get the value of 'ⅻ' and store it in a string?

sleepToken :

Both of these conditions return true:

public class Test {
    public static void main(String args[]) {
        String myStr = "ⅻⅾ℡ℬ";
        Character myChar = myStr.charAt(0); 

        System.out.println('ⅻ' == myChar);
        System.out.println("ⅻ".equals(Character.toString(myChar))); 
    }
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=23251&siteId=1