Javascript - Degree Symbol
ANSI version showing the Chrome 63 failure

This page is part of the documentation and testcases related to the issue of displaying a Degree Symbol (°) on web pages via html and javascript.

This test file

In all the test files, text is placed on a canvas using javascript code similar to the following.

Also in all test files (html and javascript), viewing the above text in notepad shows the Degree Symbol as (°) (this one is rendered as ° so that the html file encoding won't matter).

It turns out that there are 2 different ways for a text file to store the degree symbol

Both of these will display the exact same in notepad, but differently when creating a web page - depending on the browser and a variety of combinations.


The Testcases

The following table encapsulates the testcases and is identical in all 4 html files - UTF8 ANSI ANSI with Chrome Failure ANSI with meta tag

As you can see (depending on which scenario you are observing), when that code executes and the Degree Symbol is placed on a canvas, it may be rendered as either a small superscript circle or as a black diamond with a question mark.


Author: Robert Clemenzi
URL: http:// mc-computing.com / Languages / Javascript / Degree_Symbol / Degree_Symbol_ANSI_Chrome_Fails.html