Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UTF 8 or Unicode?

 
Dan Temple
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read from one source that Java uses UTF 8 to internally represent variables and such. But another source claims that it uses Unicode. What is the real story?
Thanks in advance
Dan
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It uses both in different places. For class files it uses UTF-8 representations, as per the JVM spec, and in runtime memory it generally uses straight Unicode (which is not really specified anywhere, it's just easiest, given that you need to be able to return a Unicode value for the charAt() method.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic