add encoding support to file in/out node (#2066)

* add encoding support to file in/out node

* update package.json

* change default encoding label: 'none' -> 'utf8[default]'

* add a missing message catalogue entry

* change default encoding label
This commit is contained in:
Hiroyasu Nishiyama
2019-03-07 07:28:33 +09:00
committed by Dave Conway-Jones
parent 3c013b3533
commit dc89218702
9 changed files with 1012 additions and 14 deletions

View File

@@ -860,6 +860,7 @@
"filelabel": "file",
"sendError": "Send message on error (legacy mode)",
"deletelabel": "delete __file__",
"encoding": "Encoding"
"utf8String": "UTF8 string",
"binaryBuffer": "binary buffer"
},
@@ -879,6 +880,21 @@
"deletedfile": "deleted file: __file__",
"appendedfile": "appended to file: __file__"
},
"encoding": {
"none": "default",
"native": "Native",
"unicode": "Unicode",
"japanese": "Japanese",
"chinese": "Chinese",
"korean": "Korean",
"taiwan": "Taiwan/Hong Kong",
"windows": "Windows codepages",
"iso": "ISO codepages",
"ibm": "IBM codepages",
"mac": "Mac codepages",
"koi8": "KOI8 codepages",
"misc": "Miscellaneous"
},
"errors": {
"nofilename": "No filename specified",
"invaliddelete": "Warning: Invalid delete. Please use specific delete option in config dialog.",

View File

@@ -32,6 +32,7 @@
<p>It can be configured to overwrite the entire file rather than append. For example,
when writing binary data to a file, such as an image, this option should be used
and the option to append a newline should be disabled.</p>
<p>Encoding of data written to a file can be specified from list of encodings.</p>
<p>Alternatively, this node can be configured to delete the file.</p>
</script>
@@ -63,6 +64,7 @@
split into smaller buffer chunks - the chunk size being operating system dependant, but typically 64k (Linux/Mac) or 41k (Windows).</p>
<p>When split into multiple messages, each message will have a <code>parts</code>
property set, forming a complete message sequence.</p>
<p>Encoding of input data can be specified from list of encodings if output format is string.</p>
<h4>Legacy error handling</h4>
<p>Before Node-RED 0.17, if this node hit an error whilst reading the file, it would
send a message with no <code>msg.payload</code> and <code>msg.error</code> set to the

View File

@@ -858,6 +858,7 @@
"filelabel": "file",
"sendError": "エラーメッセージを送信(互換モード)",
"deletelabel": "delete __file__",
"encoding": "エンコーディング"
"utf8String": "UTF8文字列",
"binaryBuffer": "バイナリバッファ"
},
@@ -877,6 +878,21 @@
"deletedfile": "ファイルを削除しました: __file__",
"appendedfile": "ファイルへ追記しました: __file__"
},
"encoding": {
"none": "デフォルト",
"native": "ネイティブ",
"unicode": "UNICODE",
"japanese": "日本",
"chinese": "中国",
"korean": "韓国",
"taiwan": "台湾/香港",
"windows": "Windowsコードページ",
"iso": "ISOコードページ",
"ibm": "IBMコードページ",
"mac": "Macコードページ",
"koi8": "KOI8コードページ",
"misc": "その他"
},
"errors": {
"nofilename": "ファイル名が設定されていません",
"invaliddelete": "警告: 削除が無効です。設定ダイアログで特定の削除設定を使用してください",

View File

@@ -27,6 +27,7 @@
<p>入力メッセージのペイロードをファイルの最後に追記します改行(\n)を各データの最後に追加することもできます</p>
<p><code>msg.filename</code>使</p>
<p>追記を行う代わりにファイル全体を上書きするように設定することもできます例えば画像のようなバイナリデータをファイルに書き出す場合はこのオプションを指定し改行を追記するオプションを指定しないようにします</p>
<p>ファイル出力の際のエンコーディングはエンコーディングリストから選択できます</p>
<p>この他ファイルの削除を行うことも可能です</p>
</script>
@@ -51,6 +52,7 @@
<p>Windowsではパスの区切り文字を(例えば<code>\\ユーザー\\名前</code>)</p>
<p>テキストファイルの場合行毎に分割して各々メッセージを送信することができますまたバイナリファイルの場合小さな塊のバッファに分割して送信できますバッファの分割単位はオペレーティングシステム依存ですが一般に64k(Linux/Mac)もしくは41k(Windows)です</p>
<p>複数のメッセージに分割する場合各メッセージには<code>parts</code></p>
<p>主力形式が文字列の場合入力データのエンコーディングをエンコーディングリストから選択できます</p>
<h4>旧式のエラー処理</h4>
<p>Node-RED 0.17より前の版ではファイルの読み込み時にエラーが発生すると<code>payload</code><code>error</code></p>
<p>エラーはcatchードで補足して処理することを推奨します</p>