For my test data, I use the characters:
漢字仮名交じり文
My code that writes the file is:
// Create license key file if (!File.Exists(Settings.LicenseFilesLocation + "/" + EmailAddress + "/" + LicenseFileName)) { HttpContext.Current.Response.Write(Name.Normalize()); HttpContext.Current.Response.End(); // UTF-8 StreamWriter License = File.CreateText(Settings.LicenseFilesLocation + "/" + EmailAddress + "/" + LicenseFileName); License.WriteLine("Licensed to: " + Name.Normalize()); License.Flush(); License.Close();
As you can see, I print the value before saving it to a file in order to check it, and it prints correctly. However, in the saved text file, when I open it in notepad, it appears as many squares (see screenshot):
When I copy and paste these characters, they are copied and pasted correctly:
漢字仮名交じり文
We have many customers who claim that their license file has its name in squares that they don’t like. Our program, which opens and checks this file, also shows its name as squares.
Any ideas how to fix this? When we open our txt license file, we want it to display its name completely without squares.
source share