I have an asp page rendering some text from a table into html. Some of the text has the non-breaking-space
character in it (unicode U+00A0
). The browser auto-detects the character encoding to be unicode, which is good, but it isn't rendering the
correctly. It is rendering them as � (the replacement character). When I change the page encoding to be "Western" instead of "Unicode", the � characters disappear.
Shouldn't the non-breaking-space be a normal character for a Unicode encoded web page to render? What is happening to cause this?
I have verified that the character stored in the database is the non-breaking-space by using SQL Server's ASCII
and UNICODE
functions, both return 160.
Also, when I run this code snippet String.fromCharCode(160)
it returns " ", so the browser does seem to understand that character is supposed to be a space. Could the ASP be messing those characters up between querying them and writing them as html?