| Author |
Unicode Representation
|
sr shashidhar
Greenhorn
Joined: Jan 17, 2013
Posts: 21
|
|
Hi frnds,
My question is how we are getting 8 and 56 for '\u0038'...?
thanks in advance
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
I trust you know that 38hex means 56dec?
So your compiler goes through the code, and converts all your Unicode escapes to displayed characters. Your \u0038 becomes 8 and your '\u0038' becomes '8'. That is done before you compile anything. I presume you can work out how 8f becomes 8.0 and how '8' becomes 56, now.
|
 |
Ivan Jozsef Balazs
Ranch Hand
Joined: May 22, 2012
Posts: 380
|
|
(too slow - deleted)
|
 |
Tony Docherty
Bartender
Joined: Aug 07, 2007
Posts: 1151
|
|
The unicode character \u0038 is '8' so in the first case the value 8 is assigned to the variable. In the second case you are assigning the char with a value of \u0038. This is a Hex value which when converted to decimal is 56.
Edit: Even slower
|
 |
sr shashidhar
Greenhorn
Joined: Jan 17, 2013
Posts: 21
|
|
Now i got.
Thanks Campbell Ritchie , Tony Docherty
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
You’re welcome
|
 |
 |
|
|
subject: Unicode Representation
|
|
|