Search code examples
visual-studio-2012.net-4.5windows-store-appswindows-store

Why is Encoding.ASCII class not available for Windows Store apps?


I'm using the Encoding.ASCII class in my WinForms app. Now I need to convert that into a Windows Store app. The problem is, the ASCII class is missing!

using System.Text;

Here is the assembly and in other types the System.Text.ASCII class is available but not in this one.

How can I resolve this?


Solution

  • From MSDN Forums Post 1:

    The suggestion is to use UTF8 encoding instead which is compatible with ASCII.

    From MSDN Forums Post 2:

    You should be able to use UTF8 encoding where you used ASCIIEncoding. UTF8 is a superset and should be compatible.