Dynamic generate 8-Digit-Unicode to Character
c#, character, unicode
Solution
If you write `"\U0002B695"` the whole string will be recognized as an escape sequence. In `"\\U0002B695"` however only `\\` will be recognized as an escape sequence for `\`. I don't know a way to build a string literal this way and then parse it like the compiler would do.
In order to get the string you need to convert the hexadecimal value into an int and then convert that to a string:
string txt_unicodePoint = "2B695";
int value = int.Parse(txt_unicodePoint, System.Globalization.NumberStyles.HexNumber);
string result = char.ConvertFromUtf32(value).ToString();
Problem
I am going to display Unicode dynamically, For example, I know `"\U00020001"` will display a character. (variable "standard_format" below). However, I can only show the whole string directly (`"\U00020001"`). I would like to know how can I show that string into a character.