From 7f08509ad4d4f37c72cbce22dfafc6891cec507e Mon Sep 17 00:00:00 2001 From: h-east Date: Wed, 26 Feb 2025 21:24:00 +0900 Subject: [PATCH] Update builtin.{txt,jax} --- doc/builtin.jax | 17 ++++++++++------- en/builtin.txt | 15 ++++++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/doc/builtin.jax b/doc/builtin.jax index ecb1dca68..dd5804f1a 100644 --- a/doc/builtin.jax +++ b/doc/builtin.jax @@ -1,4 +1,4 @@ -*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Feb 17 +*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Feb 23 VIMリファレンスマニュアル by Bram Moolenaar @@ -1377,10 +1377,12 @@ blob2str({blob} [, {options}]) *blob2str()* encoding このエンコーディングを使用して {blob} 内のバイ ト列をデコードする。値は |String| である。サ ポートされている値については |encoding-names| - を参照。 + を参照 (および特殊値 "none")。 *E1515* - {blob} で無効なバイトシーケンスが検出された場合はエラーが発生 - し、空のリストが返される。 + 現在の 'encoding' が "utf-8" の場合、{blob} で無効なバイトシー + ケンスが検出されるとエラーが発生し、空のリストが返される。この + 検証を抑制して無効な可能性のある文字列を取得するには、{options} + の "encoding" を "none" に設定する。 blob が空の場合は空のリストが返される。 @@ -10429,9 +10431,10 @@ str2blob({list} [, {options}]) *str2blob()* して文字をバイト列に変換する。 引数 {options} は |Dict| であり、次の項目をサポートする: - encoding このエンコーディングを使用して文字をエンコード - する。値は |String| である。サポートされている - 値については|encoding-names| を参照。 + encoding Blob を作成する前に、このエンコーディングを使 + 用して文字を変換する。 + 値は |String| である。サポートされている値につ + いては |encoding-names| を参照。 文字エンコードが失敗した場合はエラーが発生し、空の blob が返さ れる。 diff --git a/en/builtin.txt b/en/builtin.txt index 344dfdfd8..80b8a9cc4 100644 --- a/en/builtin.txt +++ b/en/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Feb 17 +*builtin.txt* For Vim version 9.1. Last change: 2025 Feb 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1309,10 +1309,14 @@ blob2str({blob} [, {options}]) *blob2str()* items: encoding Decode the bytes in {blob} using this encoding. The value is a |String|. See - |encoding-names| for the supported values. + |encoding-names| for the supported values + (plus the special value "none"). *E1515* - An error is given and an empty List is returned if - an invalid byte sequence is encountered in {blob}, + When current 'encoding' is "utf-8", an error is given and an + empty List is returned if an invalid byte sequence is + encountered in {blob}. To suppress this validation and get + potentially invalid string, set "encoding" in {options} to + "none". Returns an empty List if blob is empty. @@ -10645,7 +10649,8 @@ str2blob({list} [, {options}]) *str2blob()* The argument {options} is a |Dict| and supports the following items: - encoding Encode the characters using this encoding. + encoding Convert the characters using this encoding + before making the Blob. The value is a |String|. See |encoding-names| for the supported values.