I was wondering if there is a way to get the character for a given UTF-8 code ?
E.g.:
1103 = > "я"(russian letter)
Using Array#pack
with U
directive (UTF-8 character):
[1103].pack('U')
# => "я"
Another approach is "\u{hex}"
, e.g. "\u{4355}"
. This syntax accepts only hex numbers, not decimal. Syntax U+184B is the most commonly used one for referencing Unicode characters.