finding a text files encoding format

Updated on June 11, 2017 in [A] C# .Net
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on June 10, 2017

When i import text files from outside it uses System.Default encoding while the files generated from inside of the Unity uses UTF-8. Is there way to understand which one uses which encoding format through code?

Update: Well, i fixed it by changing the encoding of the output by using File.WriteAllText() instead of StringWriter. But I still know how to detect a text file’s or string’s encoding format.

  • Liked by
Reply
0 on June 11, 2017

System.Default most likely means UTF-8

  • Liked by
Reply
Cancel
0 on June 11, 2017

C# strings use Unicode/UTF-16

  • Liked by
Reply
Cancel