Home > database >  How to print words containing unicode? [closed]
How to print words containing unicode? [closed]

Time:10-06

I need to print Swedish words that contain unicode using Java how can I do it?

for example

Text with Unicode:- \u228sk\u228da

Output: åskåda

CodePudding user response:

Both of the following would work:

class Main {  
  public static void main(String args[]) { 
    System.out.println("åskåda"); 
    System.out.println("\u00e5sk\u00e5da");
  } 
}

Note that you need to use the hex values and must take care of specifying the encoding when reading data (from disk or network)

  •  Tags:  
  • java
  • Related