This documentation is archived and is not being maintained.
Encoding.UTF7 Property
.NET Framework 1.1
Gets an encoding for the UTF-7 format.
[Visual Basic] Public Shared ReadOnly Property UTF7 As Encoding [C#] public static Encoding UTF7 {get;} [C++] public: __property static Encoding* get_UTF7(); [JScript] public static function get UTF7() : Encoding;
Property Value
An encoding for the UTF-7 format.
Example
[Visual Basic] Imports System Imports System.IO Imports System.Text Imports Microsoft.VisualBasic Namespace UTF7Example Public Class UTF7ExampleClass Public Shared Sub Main() Dim unicodeString As String = "This string contains the unicode character Pi(" & ChrW(&H03A0) & ")" ' Create a UTF7 encoding Dim utf7 As Encoding = Encoding.UTF7 ' Converting to UTF7 encodes characters so that they will pass through ' ASCII systems such as email. Dim utf7Writer As New StreamWriter("output.txt", False, utf7) utf7Writer.WriteLine(utf7.BodyName) utf7Writer.WriteLine(unicodeString) utf7Writer.Flush() utf7Writer.Close() End Sub End Class End Namespace [C#] using System; using System.IO; using System.Text; namespace UTF7Example { public class UTF7ExampleClass { public static void Main() { string unicodeString = "This string contains the unicode character Pi(\u03a0)"; // Create a UTF7 encoding Encoding utf7 = Encoding.UTF7; // Converting to UTF7 encodes characters so that they will pass through // ASCII systems such as email. StreamWriter utf7Writer = new StreamWriter("output.txt", false, utf7); utf7Writer.WriteLine(utf7.BodyName); utf7Writer.WriteLine(unicodeString); utf7Writer.Flush(); utf7Writer.Close(); } } } [C++] #using <mscorlib.dll> using namespace System; using namespace System::IO; using namespace System::Text; int main() { String* unicodeString = S"This string contains the unicode character Pi(\u03a0)"; // Create a UTF7 encoding Encoding * utf7 = Encoding::UTF7; // Converting to UTF7 encodes characters so that they will pass through // ASCII systems such as email. StreamWriter* utf7Writer = new StreamWriter(S"output.txt", false, utf7); utf7Writer -> WriteLine(utf7 -> BodyName); utf7Writer -> WriteLine(unicodeString); utf7Writer -> Flush(); utf7Writer -> Close(); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
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, .NET Compact Framework
See Also
Show: