I have a program that reads from a file a set of characters and i need to transform this characters to their ascii representation.
En example of input is
'\n' '\0' 'a' 'b'
The input is comes from a file as a string and then is processed. To process the characters i use the getBytes() function from the string classand I don´t have any problem with regular characters ( a
, b
, ...), but with characters like \n
getBytes
method returns two ASCII values (the value from \
and the value from n
).
How can I calculate the ASCII values of the whole string \n
?