is it possible to use braille characters as string character

Viewed 425

I copied all the braille characters into a string array and was hoping to use it to read and print braille characters. However, when I was trying to compile the program.the following error message popped up

enter image description here

    private String[] alphabet= {"⠁","⠃","⠉","⠙","⠑","⠋","⠛","⠓","⠊","⠚","⠅","⠇","⠍","⠝","⠕","⠏","⠟","⠗","⠎","⠞","⠥","⠧","⠭","⠽","⠵","⠯","⠿","⠷","⠮","⠾","⠡","⠣","⠩","⠹","⠱","⠫","⠻","⠳","⠪","⠺","⠂","⠆","⠒","⠲","⠢","⠖","⠶","⠦","⠔","⠴","⠌","⠬","⠼","⠜","⠄","⠤","⠈","⠘","⠸","⠐","⠨","⠰","⠠","⠀"};

this is the string array i was trying to use.

Thanks

Edit:

Update. The program compiles and save just fine after changing the encoding preference or clicking the "save as UTF-8" button. However, I am still unable to print the character like one could with a normal string.

I am looking for sth like this

System.out.println("this is the character: "+ "⠛");

expected output

this is the character: ⠛

actual output

this is the character:

2 Answers

You need to following path to make the changes in Your eclipse IDE and change file encoding to UTF-8. Preferences --> General --> Workspace --> File Encoding

I figured out how to print the braille characters. All I had to do was to print it using its Unicode literal. (2800 - 28FF for braille characters)

for a complete list see https://en.wikipedia.org/wiki/Braille_Patterns

        System.out.println("\u28FF");

will output ⣿

Related