• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sybex OCP Java 8 Study Guide - Page 420: example omitting non-ASCII letters  RSS feed

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 420, the skipping example:

This example is working correctly with american letters while reading just one byte for each character. It's not working with special characters like german umlaut (f.e. ü).
The code with input TüGERS will output TER.
In Java the primitive char takes two bytes.
 
Marshal
Posts: 56871
174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would appear to be a different question, so should be in a thread of its own.
Please supply more details about the program and how it is going wrong.
 
author & internet detective
Marshal
Posts: 37707
575
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juerg,
You are correct. The exam doesn't cover "special" characters like that. It's a bit US centric in that regard. For that matter, it is US centric with regard to time zones too.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!