.Net uses the UTF-16 encoding. You have to convert only when having data or passing data using other encodings.
See also
Character Encoding in .NET | Microsoft Docs[
^].
With text files, the used encoding can be indicated by a
Byte order mark - Wikipedia[
^] (mandatory for UTF-16, optional - but recommended - for UTF-8) and by headers when the file is for a specific protocol like HTML or XML.
For web servers and applications there are also often configuration options for the default encoding (e.g. the
<globalization> Element | Microsoft Docs[
^]).
[EDIT]
The real question has been found.
Quote:
i want to display the string data in unicode format like im having my name is "Shahbaz" is in string format and the convert it to the unicode is
U+0053 U+0068 U+0061 U+0068 U+0062 U+0061 U+007A
You just have to create a string using that format by iterating over the characters of the input string:
StringBuilder sb = new StringBuilder(input.Length * 7);
foreach (char c in input)
{
sb.AppendFormat("U+{0:X4} ", c);
}
string output = sb.ToString();
[/EDIT]