File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UTF 8 or Unicode?

 
Dan Temple
Ranch Hand
Posts: 93
  • 0
  • 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
  • 0
  • 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.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic