Forum und email

HaruEncoder::getByteType

(PECL haru:0.0.1)

HaruEncoder::getByteType — テキスト内のバイトの型を取得する

説明

int HaruEncoder::getByteType ( string $text , int $index )

テキスト内の指定した位置のバイトの型を返します。 結果は以下のいずれかの値となります。

  • HaruEncoder::BYTE_TYPE_SINGLE - シングルバイト文字。
  • HaruEncoder::BYTE_TYPE_LEAD - マルチバイト文字の先頭バイト。
  • HaruEncoder::BYTE_TYPE_TRAIL - マルチバイト文字の後続バイト。
  • HaruEncoder::BYTE_TYPE_UNKNOWN - エンコーダが無効、あるいはバイトの型の取得に失敗。

パラメータ

text

テキスト。

index

テキスト内の位置。

エラー / 例外

エラー時に HaruException をスローします。