I am getting this weird occurrence when using unicodes in my application. I have a list of random unicodes which I then randomly assign to an object.
var icons = new List<string> { "\uf022", "\uf039", "\uf02b", "\uf1b2", "\uf07b" };
When I debug the object the Object.Icon property shows "." which is the correct value for unicode. When I display the unicodes on a XAML page the correct icons are displayed.
So when I got this working I wanted to move the unicode values into the database instead of making it random. But now when I debug the object the Object.Icon property shows "\\unicodevalue" i.e "\uf022".
When displaying this value on the XAML page, its being displayed as the text value \uf022 instead of an icon.
What is the difference between the strings in the icons list and having the string value in the database?


U+F022is not the same string as the string\uf022. Your database can (probably) store either, but make sure you're not confounded by tools that don't display things accurately. If using SQL Server, for example, useDATALENGTHto get the string size in bytes, and things likeCONVERT(VARBINARY(MAX), [column])to see the actual contents in code points. (Note also thatU+F022is an unassigned private use character and can be displayed as whatever.)