I am playing with escape character(backslash \) in java. When I get the length(number of bytes actually taken to store) of \n or \t, I get 1 and when I get length of \n\t, I get 2, as expected.
My confusion starts when I print:
length of \123 -> 1
length of \177 -> 1
length of \178 -> 2
length of \190 -> 3
How is this happening? If it's related to ASCII or extended-ASCII, then this should change from 164. Another observation is after first three characters it starts counting each char as 1 length, so e.g. \123456 has length 4.
Is it something related to the encoding? I have UTF-8 set into my IDE right now.
This could be a silly question but I don't have detail knowledge of unicode or it's encoding, can someone please explain?