• Post Reply Bookmark Topic Watch Topic
  • New Topic

Netbeans GUI editor doesn't like ASCII  RSS feed

 
Kirill Chernyshov
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm making a basic GUI with the NetBeans IDE (in Java), and I want to make a button with a √ sign in it. It didn't let me copypaste it in, so I tried using its ASCII code:



Instead of the square root sign, however, it gave me "û", and I have no idea why. Can someone please explain why this is happening, as well as offer an idea as to how I should go about this?
 
Paul Clapham
Sheriff
Posts: 22708
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That isn't ASCII. The ASCII code only goes from 0 to 127.

But on the other hand Java doesn't use ASCII. It uses Unicode, which goes from 0 to 65535. Even though it has done that since it was first invented in 1995, the word doesn't seem to have got out to people who only use the English alphabet on a daily basis.

So your 251 is the Unicode 251. That's a decimal number, its hexadecimal equivalent is FB so you'll find it on this page from the Unicode code charts. As you'll see from that chart (scroll down a bit) its Unicode name is "LATIN SMALL LETTER U WITH CIRCUMFLEX", and that's what you are seeing.

I have no idea why you would expect to see a square-root sign. See here for information about that.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!