A user asked the following question to one of my answers.
I have a unicode character
\u{0D85}
. How do I get theInt
value from it?
I was going to refer them to another Stack Overflow Q&A but I couldn't find one. These refer to converting the other direction:
- How to convert an Int to a Character in Swift
- How can I get the Unicode codepoint represented by an integer in Swift?
And these seem to be asking how to convert a number in string form to an actual Int
(as in converting "1"
to 1
).
Rather than try to fit my answer in a comment to the asker, I am going to provide an answer below. The Type of \u{0D85}
is somewhat unclear but I will cover the various possibilities.