Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

the artist formerly known as Prince

 
Martin Smith
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's with the \f formfeed character. When I try to print it I get the symbol for "the artist formerly known as Prince" (as MTV would call him) -- Honest, try it. It's what people on this forum might call foobar.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Printing "control codes" can get you all sorts of strange looking characters in DOS. Try printing '\u0001' through '\u00031' for some interesting characters.
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marilyn;

Printing "control codes" can get you all sorts of strange looking characters in DOS. Try printing '\u0001' through '\u00031' for some interesting characters.

I tried looking up 'unicode' in the java docs as well as 'control codes' and found nothing - maybe I have the wrong search criteria. So...
Why do I get the following errors

With this program

Thanks
doco
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi doco,
First, you must have exactly four digits following a unicode escape: '\u0001'. Next, your program isn't going to do what you want anyway. You need to iterate thur chars not Strings. Try this instead:

Michael Morris
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out.

doco
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael. I had left my post open while I was looking through other resources and posted what I learned before seeing yours. I like yours better.
doco
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic