Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I include the degrees and minutes symbols in Java?

Tags:

java

utf-8

Do anyone know the code for a character that is used for coordinates, i.e. longitude and lattitude? Its similar to the symbol for celsius, like an 'o'

I suspect that there's a code for it with a backslash. (\xxxxx)

enter image description here

like image 302
Björn Hallström Avatar asked Nov 30 '22 12:11

Björn Hallström


2 Answers

What you are looking for is \u00B0, the degree symbol. It may be used for temperature and angular location as is being done in your case.

You should not use an apostrophe to indicate minutes of arc. Use \u2032, the prime. If you use an apostrophe, the result might look right, but it may also fail to be useful to a crawler or screen-reader.

Seconds likewise should use \u2033, the double prime. Do not use a double quotation mark.

The image below shows a comparison of the two symbols as rendered:

Comparison of prime and apostrophe

like image 93
nanofarad Avatar answered Dec 04 '22 17:12

nanofarad


You're looking for the degree symbol U+00B0.

like image 39
Kayaman Avatar answered Dec 04 '22 17:12

Kayaman