Im trying to obtain the Unicode(code) of a character in VTL.
For example I would like to get the number 902 from the character Ά
The analogue in JS would be:
'Ά'.charCodeAt(0)
902
Similarly the char code of a blank space would be 32:
' '.charCodeAt(0)
32
What you need is the Character.codePointAt(str, index) static method.
Explanation: in VTL we need (dummy) instances to call static methods. We first convert the argument to a string and call
charAt(0)
on it to get a Character instance, just to be able to call thecodePointAt()
static method on its first character.This seems rather convoluted, alas the Java API is not so great here.