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

Has anyone gotten a question about UTF, etc

 
Rick Reumann
Ranch Hand
Posts: 281
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, one night to go before the exam and yes I should have looked into this more sooner..I know, I know. It seems like on every JQ+ test I get a question about encoding schemes (unicode, UTF8 ). Not coming from a computer science background I'm usually totally lost in conversations of such matters. I even did a search on here concerning this topic and people who know a lot more than me about it are often confused about it as well. This post in particular I was looking at
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=012999
Can maybe somone give me or point me to a real dummied down version of what I need to know concerning Unicode and UTF8 in relation to this exam. I've read and reread the chapters in RHE and Mughal and I'm still confused. The question came up on a JQ+ about how characters are stored internally in the JVM and I thought it was unicode but I was wrong. Even in Val's notes it says "Inside JVM, text is represented in 16 bit Unicode. For I/O, UTF is used. UTF uses as many bits as neeed to encode the character."
Does this kind of question ever come up on the exam? I'm really flustered
 
Erik Dark
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question came up on a JQ+ about how characters are stored internally in the JVM and I thought it was unicode but I was wrong. Even in Val's notes it says "Inside JVM, text is represented in 16 bit Unicode. For I/O, UTF is used. UTF uses as many bits as neeed to encode the character."

I can't remember seen something like this (but that doesn't guarantee anything!) I wouldn't be afraid about this...certainly not you Rick....GoodLuck!
Erik Dark
 
Stephen Batsas
Ranch Hand
Posts: 117
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question might turn up. Remember that UTF8 is the default encoding JVM uses.
Regards

Stephen Batsas
Sun Certified Programmer For Java[tm]2
 
Rob Ross
Bartender
Posts: 2205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be clear on the distinction between internal JVM characters, and characters written to a DataOutputStream.
Internally, ALL java characters are stored in Unicode, not UTF-8. This means that Strings are all composed of Unicode characters as well.
When you write a String to a DataOutputStream using writeUTF8, it will write that String using UTF-8. Otherwise, if you just use writeChars you get Unicode characters as well.
The internal, default encoding of the JVM is Unicode.
 
Brian Lugo
Ranch Hand
Posts: 165
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Goodluck on your exam Rick! Keep us posted ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic