Displaying a degree symbol on a web page

I have a program that extracts GPS coordinates from metadata and imports the results into a database. Then I display the data using PHP on the web page.

My problem. I recently created a new template, but for some reason it no longer shows the degrees symbol "°" but "".

It just seems odd to me that it works with one template but not another?

I tried changing fonts but no luck

+3


source to share


4 answers


See DEGREE CHARACTER .

Specifically, the HTML the Entity: °

.



Make sure you have the proper docstring and character encoding in both templates to make sure they are correct.

+6


source


  • Save the PHP file with UTF-8 encoding.
  • Submit your PHP file with charset = UTF-8.
  • Add META tag to your HTML with charset = UTF-8.


This will solve (almost) all of your unicode character problems.

0


source


When entering or retrieving data from a database, use htmlentities()

you can find a good guide on this function a here http://php.net/manual/en/function.htmlentities.php

0


source


You can use:

utf8_encode('YOUR TEXT');

utf8_encode converts string data from ISO-8859-1 encoding to UTF-8.

0


source







All Articles