Share via


Encoding.UTF7 プロパティ

UTF-7 形式のエンコーディングを取得します。

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;

プロパティ値

UTF-7 形式のエンコーディング。

使用例

 
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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

Encoding クラス | Encoding メンバ | System.Text 名前空間