Skip to content

Latest commit

 

History

History

java-format-unicode-encoder-slash-decoder

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

We need a reusable program to encode/decode text to unicode value as represented in Java and vice-versa.

Encoder:

Input: "hola"
Output: "\u0068\u006f\u006c\u0061"

Decoder:

Input: "\u0068\u006f\u006c\u0061"
Output: "hola"

Observations:

  • Please note that unicode values have always a backslash \ the letter u and 4 hexadecimal digits corresponding to the value in the unicode character set.
  • Codewars has some trouble showing non ASCII characters so perhaps you should try it locally first.