UnicodeEncoding クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Unicode 文字の UTF-16 エンコードを表します。
public ref class UnicodeEncoding : System::Text::Encoding
public class UnicodeEncoding : System.Text.Encoding
[System.Serializable]
public class UnicodeEncoding : System.Text.Encoding
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class UnicodeEncoding : System.Text.Encoding
type UnicodeEncoding = class
inherit Encoding
[<System.Serializable>]
type UnicodeEncoding = class
inherit Encoding
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type UnicodeEncoding = class
inherit Encoding
Public Class UnicodeEncoding
Inherits Encoding
- 継承
- 属性
例
次の例では、 UnicodeEncoding オブジェクトを使用して Unicode 文字の文字列をバイト配列にエンコードする方法を示します。 バイト配列は、データの損失がないことを示すために文字列にデコードされます。
using System;
using System.Text;
class UnicodeEncodingExample {
public static void Main() {
// The encoding.
UnicodeEncoding unicode = new UnicodeEncoding();
// Create a string that contains Unicode characters.
String unicodeString =
"This Unicode string contains two characters " +
"with codes outside the traditional ASCII code range, " +
"Pi (\u03a0) and Sigma (\u03a3).";
Console.WriteLine("Original string:");
Console.WriteLine(unicodeString);
// Encode the string.
Byte[] encodedBytes = unicode.GetBytes(unicodeString);
Console.WriteLine();
Console.WriteLine("Encoded bytes:");
foreach (Byte b in encodedBytes) {
Console.Write("[{0}]", b);
}
Console.WriteLine();
// Decode bytes back to string.
// Notice Pi and Sigma characters are still present.
String decodedString = unicode.GetString(encodedBytes);
Console.WriteLine();
Console.WriteLine("Decoded bytes:");
Console.WriteLine(decodedString);
}
}
Imports System.Text
Imports Microsoft.VisualBasic.Strings
Class UnicodeEncodingExample
Public Shared Sub Main()
' The encoding.
Dim uni As New UnicodeEncoding()
' Create a string that contains Unicode characters.
Dim unicodeString As String = _
"This Unicode string contains two characters " & _
"with codes outside the traditional ASCII code range, " & _
"Pi (" & ChrW(928) & ") and Sigma (" & ChrW(931) & ")."
Console.WriteLine("Original string:")
Console.WriteLine(unicodeString)
' Encode the string.
Dim encodedBytes As Byte() = uni.GetBytes(unicodeString)
Console.WriteLine()
Console.WriteLine("Encoded bytes:")
Dim b As Byte
For Each b In encodedBytes
Console.Write("[{0}]", b)
Next b
Console.WriteLine()
' Decode bytes back to string.
' Notice Pi and Sigma characters are still present.
Dim decodedString As String = uni.GetString(encodedBytes)
Console.WriteLine()
Console.WriteLine("Decoded bytes:")
Console.WriteLine(decodedString)
End Sub
End Class
次の例では、エンコードされたバイトをファイルに書き込み、バイト 順マーク (BOM) でバイト ストリームのプレフィックスを付ける点を除き、前の文字列と同じ文字列を使用します。 次に、 StreamReader オブジェクトを使用してテキスト ファイルとして、バイナリ ファイルとして、2 つの異なる方法でファイルを読み取ります。 ご期待のとおり、新しく読み取られた文字列には BOM は含まれておりいません。
using System;
using System.IO;
using System.Text;
public class Example
{
public static void Main()
{
// Create a UTF-16 encoding that supports a BOM.
Encoding unicode = new UnicodeEncoding();
// A Unicode string with two characters outside an 8-bit code range.
String unicodeString =
"This Unicode string has 2 characters outside the " +
"ASCII range: \n" +
"Pi (\u03A0)), and Sigma (\u03A3).";
Console.WriteLine("Original string:");
Console.WriteLine(unicodeString);
Console.WriteLine();
// Encode the string.
Byte[] encodedBytes = unicode.GetBytes(unicodeString);
Console.WriteLine("The encoded string has {0} bytes.\n",
encodedBytes.Length);
// Write the bytes to a file with a BOM.
var fs = new FileStream(@".\UTF8Encoding.txt", FileMode.Create);
Byte[] bom = unicode.GetPreamble();
fs.Write(bom, 0, bom.Length);
fs.Write(encodedBytes, 0, encodedBytes.Length);
Console.WriteLine("Wrote {0} bytes to the file.\n", fs.Length);
fs.Close();
// Open the file using StreamReader.
var sr = new StreamReader(@".\UTF8Encoding.txt");
String newString = sr.ReadToEnd();
sr.Close();
Console.WriteLine("String read using StreamReader:");
Console.WriteLine(newString);
Console.WriteLine();
// Open the file as a binary file and decode the bytes back to a string.
fs = new FileStream(@".\UTF8Encoding.txt", FileMode.Open);
Byte[] bytes = new Byte[fs.Length];
fs.Read(bytes, 0, (int)fs.Length);
fs.Close();
String decodedString = unicode.GetString(bytes);
Console.WriteLine("Decoded bytes:");
Console.WriteLine(decodedString);
}
}
// The example displays the following output:
// Original string:
// This Unicode string has 2 characters outside the ASCII range:
// Pi (π), and Sigma (Σ).
//
// The encoded string has 172 bytes.
//
// Wrote 174 bytes to the file.
//
// String read using StreamReader:
// This Unicode string has 2 characters outside the ASCII range:
// Pi (π), and Sigma (Σ).
//
// Decoded bytes:
// This Unicode string has 2 characters outside the ASCII range:
// Pi (π), and Sigma (Σ).
Imports System.IO
Imports System.Text
Class Example
Public Shared Sub Main()
' Create a UTF-16 encoding that supports a BOM.
Dim unicode As New UnicodeEncoding()
' A Unicode string with two characters outside an 8-bit code range.
Dim unicodeString As String = _
"This Unicode string has 2 characters outside the " &
"ASCII range: " & vbCrLf &
"Pi (" & ChrW(&h03A0) & "), and Sigma (" & ChrW(&h03A3) & ")."
Console.WriteLine("Original string:")
Console.WriteLine(unicodeString)
Console.WriteLine()
' Encode the string.
Dim encodedBytes As Byte() = unicode.GetBytes(unicodeString)
Console.WriteLine("The encoded string has {0} bytes.",
encodedBytes.Length)
Console.WriteLine()
' Write the bytes to a file with a BOM.
Dim fs As New FileStream(".\UnicodeEncoding.txt", FileMode.Create)
Dim bom() As Byte = unicode.GetPreamble()
fs.Write(bom, 0, bom.Length)
fs.Write(encodedBytes, 0, encodedBytes.Length)
Console.WriteLine("Wrote {0} bytes to the file.", fs.Length)
fs.Close()
Console.WriteLine()
' Open the file using StreamReader.
Dim sr As New StreamReader(".\UnicodeEncoding.txt")
Dim newString As String = sr.ReadToEnd()
sr.Close()
Console.WriteLine("String read using StreamReader:")
Console.WriteLine(newString)
Console.WriteLine()
' Open the file as a binary file and decode the bytes back to a string.
fs = new FileStream(".\UnicodeEncoding.txt", FileMode.Open)
Dim bytes(fs.Length - 1) As Byte
fs.Read(bytes, 0, fs.Length)
fs.Close()
Dim decodedString As String = unicode.GetString(bytes)
Console.WriteLine("Decoded bytes:")
Console.WriteLine(decodedString)
End Sub
End Class
' The example displays the following output:
' Original string:
' This Unicode string has 2 characters outside the ASCII range:
' Pi (π), and Sigma (Σ).
'
' The encoded string has 172 bytes.
'
' Wrote 174 bytes to the file.
'
' String read using StreamReader:
' This Unicode string has 2 characters outside the ASCII range:
' Pi (π), and Sigma (Σ).
'
' Decoded bytes:
' This Unicode string has 2 characters outside the ASCII range:
' Pi (π), and Sigma (Σ).
注釈
エンコードは、一連の Unicode 文字をバイト シーケンスに変換するプロセスです。 デコードは、エンコードされたバイトのシーケンスを一連の Unicode 文字に変換するプロセスです。
Unicode 標準では、サポートされているすべてのスクリプトの各文字にコード ポイント (数字) が割り当てられます。 Unicode 変換形式 (UTF) は、そのコード ポイントをエンコードする方法です。 Unicode 標準では、次の UDF が使用されます。
UTF-8。各コード ポイントを 1 ~ 4 バイトのシーケンスとして表します。
UTF-16。各コード ポイントを 1 ~ 2 つの 16 ビット整数のシーケンスとして表します。
UTF-32。各コード ポイントを 32 ビット整数として表します。
System.Textでサポートされる UDF とその他のエンコードの詳細については、「.NET Framework での文字エンコード」を参照してください。
UnicodeEncoding クラスは UTF-16 エンコードを表します。 エンコーダーは、ビッグ エンディアン バイト順 (最上位バイト優先) またはリトル エンディアン バイト順 (最下位バイト優先) のいずれかを使用できます。 たとえば、ラテン大文字 A (コード ポイント U+0041) は、次のようにシリアル化されます (16 進数)。
ビッグ エンディアン バイト順: 00 00 00 41
リトル エンディアン バイト順: 41 00 00 00
一般に、特定のプラットフォームのネイティブ バイト順を使用して Unicode 文字を格納する方が効率的です。 たとえば、Intel コンピューターなどのリトル エンディアン プラットフォームでは、リトル エンディアン バイト順を使用することをお勧めします。 UnicodeEncoding クラスは、Windows コード ページ 1200 (リトル エンディアン バイト順) と 1201 (ビッグ エンディアン バイト順) に対応します。 BitConverter.IsLittleEndian メソッドを呼び出すことで、特定のアーキテクチャの "エンディアン" を判断できます。
必要に応じて、 UnicodeEncoding オブジェクトはバイト オーダー マーク (BOM) を提供します。これはバイト配列であり、エンコード プロセスに起因するバイト シーケンスの前に付けることができます。 プリアンブルにバイトオーダーマーク(BOM)が含まれている場合は、デコーダーがバイトオーダーと変換形式またはUTFを決定するのに役立ちます。
UnicodeEncoding インスタンスが BOM を提供するように構成されている場合は、GetPreamble メソッドを呼び出して取得できます。それ以外の場合、メソッドは空の配列を返します。 UnicodeEncoding オブジェクトが BOM サポート用に構成されている場合でも、必要に応じてエンコードされたバイト ストリームの先頭に BOM を含める必要があります。UnicodeEncoding クラスのエンコード メソッドでは、この処理は自動的には行われません。
注意事項
エラー検出を有効にし、クラス インスタンスのセキュリティを強化するには、UnicodeEncoding(Boolean, Boolean, Boolean) コンストラクターを呼び出し、そのthrowOnInvalidBytes引数を true に設定して、UnicodeEncoding オブジェクトをインスタンス化する必要があります。 エラー検出では、無効な一連の文字またはバイトを検出するメソッドは、 ArgumentExceptionをスローします。 エラー検出がないと、例外はスローされず、無効なシーケンスは通常無視されます。
バイト オーダー マーク (BOM) を提供するかどうか、ビッグ エンディアン エンコードとリトル エンディアン エンコードのどちらが必要か、エラー検出を有効にするかどうかに応じて、さまざまな方法で UnicodeEncoding オブジェクトをインスタンス化できます。 次の表に、UnicodeEncoding コンストラクターと、UnicodeEncoding オブジェクトを返すEncodingプロパティを示します。
| メンバー | エンディアン | BOM | エラー検出 |
|---|---|---|---|
| BigEndianUnicode | ビッグエンディアン | はい | いいえ (代替フォールバック) |
| Encoding.Unicode | リトル エンディアン | はい | いいえ (代替フォールバック) |
| UnicodeEncoding.UnicodeEncoding() | リトル エンディアン | はい | いいえ (代替フォールバック) |
| UnicodeEncoding(Boolean, Boolean) | Configurable | Configurable | いいえ (代替フォールバック) |
| UnicodeEncoding.UnicodeEncoding(Boolean, Boolean, Boolean) | Configurable | Configurable | Configurable |
GetByteCountメソッドは、Unicode 文字のセットをエンコードする結果のバイト数を決定し、GetBytes メソッドは実際のエンコードを実行します。
同様に、 GetCharCount メソッドはバイト シーケンスをデコードする結果の文字数を決定し、 GetChars メソッドと GetString メソッドは実際のデコードを実行します。
複数のブロックにまたがるデータ (100,000 文字のセグメントでエンコードされた 100 万文字の文字列など) をエンコードまたはデコードするときに状態情報を保存できるエンコーダーまたはデコーダーの場合は、それぞれ GetEncoder プロパティと GetDecoder プロパティを使用します。
コンストラクター
| 名前 | 説明 |
|---|---|
| UnicodeEncoding() |
UnicodeEncoding クラスの新しいインスタンスを初期化します。 |
| UnicodeEncoding(Boolean, Boolean, Boolean) |
UnicodeEncoding クラスの新しいインスタンスを初期化します。 パラメーターは、ビッグ エンディアン バイトオーダーを使用するかどうか、Unicode バイトオーダー マークを指定するかどうか、および無効なエンコードが検出されたときに例外をスローするかどうかを指定します。 |
| UnicodeEncoding(Boolean, Boolean) |
UnicodeEncoding クラスの新しいインスタンスを初期化します。 パラメーターは、ビッグ エンディアン バイトオーダーを使用するかどうか、および GetPreamble() メソッドが Unicode バイトオーダー マークを返すかどうかを指定します。 |
フィールド
| 名前 | 説明 |
|---|---|
| CharSize |
Unicode 文字サイズをバイト単位で表します。 このフィールドは定数です。 |
プロパティ
| 名前 | 説明 |
|---|---|
| BodyName |
派生クラスでオーバーライドされると、メール エージェントの本文タグで使用できる現在のエンコードの名前を取得します。 (継承元 Encoding) |
| CodePage |
派生クラスでオーバーライドされると、現在の Encodingのコード ページ識別子を取得します。 (継承元 Encoding) |
| DecoderFallback |
現在のDecoderFallback オブジェクトのEncoding オブジェクトを取得または設定します。 (継承元 Encoding) |
| EncoderFallback |
現在のEncoderFallback オブジェクトのEncoding オブジェクトを取得または設定します。 (継承元 Encoding) |
| EncodingName |
派生クラスでオーバーライドされると、現在のエンコードの人間が判読できる説明を取得します。 (継承元 Encoding) |
| HeaderName |
派生クラスでオーバーライドされると、メール エージェントのヘッダー タグで使用できる現在のエンコードの名前を取得します。 (継承元 Encoding) |
| IsBrowserDisplay |
派生クラスでオーバーライドされると、現在のエンコードをブラウザー クライアントがコンテンツの表示に使用できるかどうかを示す値を取得します。 (継承元 Encoding) |
| IsBrowserSave |
派生クラスでオーバーライドされた場合、コンテンツを保存するためにブラウザー クライアントが現在のエンコードを使用できるかどうかを示す値を取得します。 (継承元 Encoding) |
| IsMailNewsDisplay |
派生クラスでオーバーライドされた場合、現在のエンコードをメールおよびニュース クライアントがコンテンツを表示するために使用できるかどうかを示す値を取得します。 (継承元 Encoding) |
| IsMailNewsSave |
派生クラスでオーバーライドされると、現在のエンコードをメールおよびニュース クライアントがコンテンツの保存に使用できるかどうかを示す値を取得します。 (継承元 Encoding) |
| IsReadOnly |
派生クラスでオーバーライドされると、現在のエンコードが読み取り専用かどうかを示す値を取得します。 (継承元 Encoding) |
| IsSingleByte |
派生クラスでオーバーライドされた場合、現在のエンコードで 1 バイト コード ポイントを使用するかどうかを示す値を取得します。 (継承元 Encoding) |
| Preamble |
UTF-16 形式でエンコードされた Unicode バイトオーダー マークを取得します (このオブジェクトが UTF-16 形式を指定するように構成されている場合)。 |
| Preamble |
派生クラスでオーバーライドされると、使用されるエンコードを指定するバイトシーケンスを含むスパンを返します。 (継承元 Encoding) |
| WebName |
派生クラスでオーバーライドされると、現在のエンコードのインターネット割り当て番号機関 (IANA) に登録されている名前を取得します。 (継承元 Encoding) |
| WindowsCodePage |
派生クラスでオーバーライドされると、現在のエンコードに最も近い Windows オペレーティング システム コード ページを取得します。 (継承元 Encoding) |
メソッド
| 名前 | 説明 |
|---|---|
| Clone() |
派生クラスでオーバーライドされた場合は、現在の Encoding オブジェクトの簡易コピーを作成します。 (継承元 Encoding) |
| Equals(Object) |
指定した Object が現在の UnicodeEncoding オブジェクトと等しいかどうかを判断します。 |
| GetByteCount(Char[], Int32, Int32) |
指定した文字配列から文字セットをエンコードすることによって生成されるバイト数を計算します。 |
| GetByteCount(Char[]) |
派生クラスでオーバーライドされた場合、指定した文字配列内のすべての文字をエンコードすることによって生成されるバイト数を計算します。 (継承元 Encoding) |
| GetByteCount(Char*, Int32) |
指定した文字ポインターから始まる一連の文字をエンコードすることによって生成されるバイト数を計算します。 |
| GetByteCount(Char*, Int32) |
派生クラスでオーバーライドされると、指定した文字ポインターから始まる文字のセットをエンコードすることによって生成されるバイト数を計算します。 (継承元 Encoding) |
| GetByteCount(ReadOnlySpan<Char>) |
派生クラスでオーバーライドされた場合、指定した文字スパンの文字をエンコードすることによって生成されるバイト数を計算します。 (継承元 Encoding) |
| GetByteCount(String, Int32, Int32) |
派生クラスでオーバーライドされると、指定した文字列から文字のセットをエンコードすることによって生成されるバイト数を計算します。 (継承元 Encoding) |
| GetByteCount(String) |
指定した文字列内の文字をエンコードすることによって生成されるバイト数を計算します。 |
| GetBytes(Char[], Int32, Int32, Byte[], Int32) |
指定した文字配列の文字セットを、指定したバイト配列にエンコードします。 |
| GetBytes(Char[], Int32, Int32) |
派生クラスでオーバーライドされると、指定した文字配列の文字セットをバイトシーケンスにエンコードします。 (継承元 Encoding) |
| GetBytes(Char[]) |
派生クラスでオーバーライドされると、指定した文字配列内のすべての文字をバイト シーケンスにエンコードします。 (継承元 Encoding) |
| GetBytes(Char*, Int32, Byte*, Int32) |
指定した文字ポインターから始まる一連の文字を、指定したバイト ポインターから始めて格納されるバイトシーケンスにエンコードします。 |
| GetBytes(Char*, Int32, Byte*, Int32) |
派生クラスでオーバーライドされると、指定した文字ポインターから始まる一連の文字を、指定したバイト ポインターから始めて格納されるバイトシーケンスにエンコードします。 (継承元 Encoding) |
| GetBytes(ReadOnlySpan<Char>, Span<Byte>) |
派生クラスでオーバーライドされると、指定した読み取り専用スパンの文字セットをバイトスパンにエンコードします。 (継承元 Encoding) |
| GetBytes(String, Int32, Int32, Byte[], Int32) |
指定した String の文字セットを、指定したバイト配列にエンコードします。 |
| GetBytes(String, Int32, Int32) |
派生クラスでオーバーライドされると、指定した |
| GetBytes(String) |
指定した文字列から指定したバイト配列に一連の文字をエンコードします。 |
| GetBytes(String) |
派生クラスでオーバーライドされると、指定した文字列内のすべての文字をバイト シーケンスにエンコードします。 (継承元 Encoding) |
| GetCharCount(Byte[], Int32, Int32) |
指定したバイト配列からバイト シーケンスをデコードすることによって生成される文字数を計算します。 |
| GetCharCount(Byte[]) |
派生クラスでオーバーライドされると、指定したバイト配列内のすべてのバイトをデコードすることによって生成される文字数を計算します。 (継承元 Encoding) |
| GetCharCount(Byte*, Int32) |
指定したバイト ポインターから始まるバイト シーケンスをデコードすることによって生成される文字数を計算します。 |
| GetCharCount(Byte*, Int32) |
派生クラスでオーバーライドされると、指定したバイト ポインターから始まるバイト シーケンスをデコードすることによって生成される文字数を計算します。 (継承元 Encoding) |
| GetCharCount(ReadOnlySpan<Byte>) |
派生クラスでオーバーライドされると、指定された読み取り専用バイト スパンをデコードすることによって生成される文字数を計算します。 (継承元 Encoding) |
| GetChars(Byte[], Int32, Int32, Char[], Int32) |
指定したバイト配列から指定した文字配列にバイト シーケンスをデコードします。 |
| GetChars(Byte[], Int32, Int32) |
派生クラスでオーバーライドされると、指定したバイト配列のバイト シーケンスを一連の文字にデコードします。 (継承元 Encoding) |
| GetChars(Byte[]) |
派生クラスでオーバーライドされると、指定したバイト配列内のすべてのバイトを一連の文字にデコードします。 (継承元 Encoding) |
| GetChars(Byte*, Int32, Char*, Int32) |
指定したバイト ポインターから始まるバイト シーケンスを、指定した文字ポインターから始めて格納される文字のセットにデコードします。 |
| GetChars(Byte*, Int32, Char*, Int32) |
派生クラスでオーバーライドされると、指定したバイト ポインターから始まるバイトシーケンスを、指定した文字ポインターから始めて格納される文字のセットにデコードします。 (継承元 Encoding) |
| GetChars(ReadOnlySpan<Byte>, Span<Char>) |
派生クラスでオーバーライドされると、指定した読み取り専用バイト スパン内のすべてのバイトを文字スパンにデコードします。 (継承元 Encoding) |
| GetDecoder() |
UTF-16 でエンコードされたバイト シーケンスを Unicode 文字のシーケンスに変換するデコーダーを取得します。 |
| GetEncoder() |
Unicode 文字のシーケンスを UTF-16 でエンコードされたバイト シーケンスに変換するエンコーダーを取得します。 |
| GetEncoder() |
派生クラスでオーバーライドされると、Unicode 文字のシーケンスをエンコードされたバイト シーケンスに変換するエンコーダーを取得します。 (継承元 Encoding) |
| GetHashCode() |
現在のインスタンスのハッシュ コードを返します。 |
| GetMaxByteCount(Int32) |
指定した文字数をエンコードすることによって生成される最大バイト数を計算します。 |
| GetMaxCharCount(Int32) |
指定したバイト数をデコードすることによって生成される最大文字数を計算します。 |
| GetPreamble() |
このインスタンスのコンストラクターがバイトオーダー マークを要求する場合は、UTF-16 形式でエンコードされた Unicode バイトオーダー マークを返します。 |
| GetString(Byte[], Int32, Int32) |
バイト配列から文字列にバイト範囲をデコードします。 |
| GetString(Byte[], Int32, Int32) |
派生クラスでオーバーライドされると、指定したバイト配列のバイト シーケンスを文字列にデコードします。 (継承元 Encoding) |
| GetString(Byte[]) |
派生クラスでオーバーライドされると、指定したバイト配列内のすべてのバイトを文字列にデコードします。 (継承元 Encoding) |
| GetString(Byte*, Int32) |
派生クラスでオーバーライドされると、指定したアドレスから始まる指定したバイト数を文字列にデコードします。 (継承元 Encoding) |
| GetString(ReadOnlySpan<Byte>) |
派生クラスでオーバーライドされると、指定したバイト スパン内のすべてのバイトを文字列にデコードします。 (継承元 Encoding) |
| GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
| IsAlwaysNormalized() |
既定の正規化形式を使用して、現在のエンコードが常に正規化されるかどうかを示す値を取得します。 (継承元 Encoding) |
| IsAlwaysNormalized(NormalizationForm) |
派生クラスでオーバーライドされると、指定された正規化形式を使用して、現在のエンコードが常に正規化されるかどうかを示す値を取得します。 (継承元 Encoding) |
| MemberwiseClone() |
現在の Objectの簡易コピーを作成します。 (継承元 Object) |
| ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
| TryGetBytes(ReadOnlySpan<Char>, Span<Byte>, Int32) |
宛先が十分に大きい場合は、指定した読み取り専用スパンの文字セットをバイトスパンにエンコードします。 (継承元 Encoding) |
| TryGetChars(ReadOnlySpan<Byte>, Span<Char>, Int32) |
宛先が十分に大きい場合は、指定した読み取り専用スパンからバイトのセットを文字のスパンにデコードします。 (継承元 Encoding) |
拡張メソッド
| 名前 | 説明 |
|---|---|
| GetBytes(Encoding, ReadOnlySequence<Char>, IBufferWriter<Byte>) |
指定したReadOnlySequence<T>をデコードし、指定した |
| GetBytes(Encoding, ReadOnlySequence<Char>, Span<Byte>) |
指定したReadOnlySequence<T>を使用して指定した |
| GetBytes(Encoding, ReadOnlySequence<Char>) |
指定したReadOnlySequence<T>を使用して、指定したByteをEncoding配列にエンコードします。 |
| GetBytes(Encoding, ReadOnlySpan<Char>, IBufferWriter<Byte>) |
指定したReadOnlySpan<T>を使用して指定した |
| GetChars(Encoding, ReadOnlySequence<Byte>, IBufferWriter<Char>) |
指定したReadOnlySequence<T>をデコードし、指定した |
| GetChars(Encoding, ReadOnlySequence<Byte>, Span<Char>) |
指定したReadOnlySequence<T>をデコードし、指定した |
| GetChars(Encoding, ReadOnlySpan<Byte>, IBufferWriter<Char>) |
指定したReadOnlySpan<T>をデコードし、指定した |
| GetString(Encoding, ReadOnlySequence<Byte>) |
指定したReadOnlySequence<T>を使用して、指定したStringをEncodingにデコードします。 |