Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia: Extract unicode key from a character

Tags:

unicode

julia

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?

like image 817
Mikael Fremling Avatar asked Sep 06 '25 08:09

Mikael Fremling


1 Answers

Use codepoint:

julia> codepoint('e')
0x00000065

julia> codepoint('ë')
0x000000eb
like image 140
Bogumił Kamiński Avatar answered Sep 09 '25 04:09

Bogumił Kamiński