UTF7Encoding.GetDecoder メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > UTF7Encoding.GetDecoder メソッドの意味・解説 

UTF7Encoding.GetDecoder メソッド

UTF-7エンコードされたバイト シーケンスUnicode 文字シーケンス変換するデコーダ取得します

名前空間: System.Text
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説
使用例使用例

次のコード例は、GetDecoder メソッド使用してUTF-7エンコードされたバイト文字シーケンス変換するデコーダ取得する方法示してます。

Imports System
Imports System.Text

Class UTF7EncodingExample
    
    Public Shared Sub Main()
        Dim chars() As Char
        Dim bytes() As Byte
 = {99, 43, 65, 119, 67, 103, 111, 65, 45}
        
        Dim utf7Decoder As Decoder = Encoding.UTF7.GetDecoder()
        
        Dim charCount As Integer
 = utf7Decoder.GetCharCount(bytes, 0, bytes.Length)
        chars = New Char(charCount - 1) {}
        Dim charsDecodedCount As Integer
 = utf7Decoder.GetChars(bytes, 0, bytes.Length, chars, 0)
        
        Console.WriteLine("{0} characters used to decode bytes.",
 charsDecodedCount)
        
        Console.Write("Decoded chars: ")
        Dim c As Char
        For Each c In  chars
            Console.Write("[{0}]", c)
        Next c
        Console.WriteLine()
    End Sub 'Main
End Class 'UTF7EncodingExample
using System;
using System.Text;

class UTF7EncodingExample {
    public static void Main()
 {
        Char[] chars;
        Byte[] bytes = new Byte[] {
            99, 43, 65, 119, 67, 103, 111, 65, 45
        };

        Decoder utf7Decoder = Encoding.UTF7.GetDecoder();

        int charCount = utf7Decoder.GetCharCount(bytes, 0, bytes.Length);
        chars = new Char[charCount];
        int charsDecodedCount = utf7Decoder.GetChars(bytes, 0,
 bytes.Length, chars, 0);

        Console.WriteLine(
            "{0} characters used to decode bytes.", charsDecodedCount
        );

        Console.Write("Decoded chars: ");
        foreach (Char c in chars) {
            Console.Write("[{0}]", c);
        }
        Console.WriteLine();
    }
}
using namespace System;
using namespace System::Text;
using namespace System::Collections;
int main()
{
   array<Char>^chars;
   array<Byte>^bytes = {99,43,65,119,67,103,111,65,45};
   Decoder^ utf7Decoder = Encoding::UTF7->GetDecoder();
   int charCount = utf7Decoder->GetCharCount( bytes, 0, bytes->Length
 );
   chars = gcnew array<Char>(charCount);
   int charsDecodedCount = utf7Decoder->GetChars( bytes, 0,
 bytes->Length, chars, 0 );
   Console::WriteLine( "{0} characters used to decode bytes.", charsDecodedCount
 );
   Console::Write( "Decoded chars: " );
   IEnumerator^ myEnum = chars->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      Char c = safe_cast<Char>(myEnum->Current);
      Console::Write( "[{0}]", c.ToString() );
   }

   Console::WriteLine();
}

import System.*;
import System.Text.*;

class UTF7EncodingExample
{
    public static void main(String[]
 args)
    {
        char chars[];
        ubyte bytes[] = new ubyte[] { 99, 43, 65, 119, 67, 103,
 111, 65, 45 };
        Decoder utf7Decoder = Encoding.get_UTF7().GetDecoder();
        int charCount = utf7Decoder.GetCharCount(bytes, 0, bytes.length);
        chars = new char[charCount];
        int charsDecodedCount = utf7Decoder.GetChars(bytes,
            0, bytes.length, chars, 0);
        Console.WriteLine("{0} characters used to decode bytes.",
            String.valueOf(charsDecodedCount));
        Console.Write("Decoded chars: ");
        for(int iCtr = 0; iCtr < chars.length;
 iCtr++) {
            char c = chars[iCtr];
            Console.Write("[{0}]", String.valueOf(c));
        }
        Console.WriteLine();
    } //main
} //UTF7EncodingExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
UTF7Encoding クラス
UTF7Encoding メンバ
System.Text 名前空間
Decoder クラス
GetChars
GetString
GetCharCount
GetEncoder



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

UTF7Encoding.GetDecoder メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



UTF7Encoding.GetDecoder メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS