unicodejulia

Julia: Extract unicode key from a character


In Julian, I want to know the specific unicide-key of a character and save it to a variable. How to I do that?

I can for instance write Unicode characters in the REPL and it will gladly tell me their Unicode key.

julia> 'ë'
'ë': Unicode U+00EB (category Ll: Letter, lowercase)

julia> 'e'
'e': ASCII/Unicode U+0065 (category Ll: Letter, lowercase)

How do i extract the U+00EB and U+0065?


Solution

  • Use codepoint:

    julia> codepoint('e')
    0x00000065
    
    julia> codepoint('ë')
    0x000000eb