This documentation is archived and is not being maintained.

Encoding.IsBrowserDisplay Property

Gets an indication whether this encoding can be used for display by browser clients.

[Visual Basic]
Public Overridable ReadOnly Property IsBrowserDisplay As Boolean
[C#]
public virtual bool IsBrowserDisplay {get;}
[C++]
public: __property virtual bool get_IsBrowserDisplay();
[JScript]
public function get IsBrowserDisplay() : Boolean;

Property Value

true if this encoding can be used for display; otherwise, false.

Remarks

For example, this property returns true for code page 1252 (windows-1252), but false for code page 437 (IBM-437).

Example

[Visual Basic] 
Imports System
Imports System.Text

Namespace IsPropertyExamples
   Class Class1
      Shared Sub Main()
         ' Create a very basic encoding and display its properties.
         ' Use the IBM-437 encoding.
         Dim myEncoding437 As Encoding = Encoding.GetEncoding(437)
         ShowBrowserAndMailProperties(myEncoding437)

         Console.WriteLine()

         ' Create a well-known encoding and display its properties.
         ' Use the Windows-1252 encoding.
         Dim myEncoding1252 As Encoding = Encoding.GetEncoding(1252)
         ShowBrowserAndMailProperties(myEncoding1252)
      End Sub

      Private Shared Sub ShowBrowserAndMailProperties(ByVal myEncoding As Encoding)
         ' Display the properties to the console.
         Console.WriteLine("Encoding name: {0}", myEncoding.EncodingName)
         Console.WriteLine("IsBrowserDisplay: {0}", myEncoding.IsBrowserDisplay)
         Console.WriteLine("IsBrowserSave: {0}", myEncoding.IsBrowserSave)
         Console.WriteLine("IsMailNewsDisplay: {0}", myEncoding.IsMailNewsDisplay)
         Console.WriteLine("IsMailNewsSave: {0}", myEncoding.IsMailNewsSave)
      End Sub
   End Class 
End Namespace

[C#] 
using System;
using System.Text;

namespace IsPropertyExamples
{
   class Class1
   {
      static void Main()
      {
         // Create a basic encoding and display its properties.
         // Use the IBM-437 encoding.
         Encoding myEncoding437 = Encoding.GetEncoding(437); 
         ShowBrowserAndMailProperties(myEncoding437);

         Console.WriteLine();

         // Create a well-known encoding and display its properties.
         // Use the Windows-1252 encoding.
         Encoding myEncoding1252 = Encoding.GetEncoding(1252); 
         ShowBrowserAndMailProperties(myEncoding1252);
      }

      private static void ShowBrowserAndMailProperties(Encoding myEncoding)
      {
         // Display the properties to the console.
         Console.WriteLine("Encoding name: {0}", myEncoding.EncodingName);
         Console.WriteLine("IsBrowserDisplay: {0}", myEncoding.IsBrowserDisplay);
         Console.WriteLine("IsBrowserSave: {0}", myEncoding.IsBrowserSave);
         Console.WriteLine("IsMailNewsDisplay: {0}", myEncoding.IsMailNewsDisplay);
         Console.WriteLine("IsMailNewsSave: {0}", myEncoding.IsMailNewsSave);
      }
   }
}

[C++] 
#using <mscorlib.dll>
using namespace System;
using namespace System::Text;

static void ShowBrowserAndMailProperties(Encoding * myEncoding)
{
   // Display the properties to the console.
   Console::WriteLine(S"Encoding name: {0}", myEncoding -> EncodingName);
   Console::WriteLine(S"IsBrowserDisplay: {0}", __box(myEncoding -> IsBrowserDisplay));
   Console::WriteLine(S"IsBrowserSave: {0}", __box(myEncoding -> IsBrowserSave));
   Console::WriteLine(S"IsMailNewsDisplay: {0}", __box(myEncoding -> IsMailNewsDisplay));
   Console::WriteLine(S"IsMailNewsSave: {0}", __box(myEncoding -> IsMailNewsSave));
}

int main() 
{
   // Create a very basic encoding and display its properties.
   // Use the IBM-437 encoding.
   Encoding * myEncoding437 = Encoding::GetEncoding(437);
   ShowBrowserAndMailProperties(myEncoding437);

   Console::WriteLine();

   // Create a well-known encoding and display its properties.
   // Use the Windows-1252 encoding.
   Encoding * myEncoding1252 = Encoding::GetEncoding(1252);
   ShowBrowserAndMailProperties(myEncoding1252);
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Encoding Class | Encoding Members | System.Text Namespace

Show: