IU need to take a char in UTF-8 and convert it to an ascii [sic] int
(decimal)
eg "a" = 97
which is then converted to the string "97"
Is there a simple way to do this?
First of all, a 'char' constant in Java is indicated with single quotes,
not double quotes.
char letter = 'a';
Second of all, 'char' in Java is a numeric type, so conversion to a
numeric value is not needed.
Third of all, are you absolutely certain you want to convert the 16-bit
value of a 'char' to a 7-bit ASCII value? What about code points that
require 32 bits to express? How would you convert those to a 7-bit
encoding?
Finally, are you asking about direct numeric conversions, i.e., to
output simply the numeric 16-bit value of the 'char', or are you asking
about converting between different text encodings, e.g., between UTF-8
and ASCII? The answer to this question is key, because if you are
talking about encodings then the answer is anything but "that easy"!