Space Character in XML doc gets converted to funky ? char in SQL Server and on web page
This is a snippet of text from the source xml document:
Great Lakes. The largest
It looks like there is a normal space between the period after Lakes and the word The after the period. But this is what it turns into in Sql Server.
Great Lakes.�The largest
I assume I need to replace the unknown character with a regular space character in our import tool (a c# console app) prior to loading the file as a proper XmlDocument
. We're already doing stuff like that:
_buf = _buf.Replace("\x1E", "");开发者_运维百科
_buf = _buf.Replace("\x1C", "");
The person who wrote that isn't here anymore and I don't have much experience with character issues like this.
Simply replacing on that question mark character seems to have fixed the problem.
_buf = _buf.Replace("�", " ");
It may be a naive approach, but there are no more funky chars on the web page so I'm going with it for now.
精彩评论