> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# encDecode

> 指定したエンコード形式を使用して、エンコードされたファイルまたはデータ文字列をデコードします。

export const siteNameShort = "Arc";

エンコードされたファイルまたはデータ文字列をデコードします。

## 必要なパラメータ

次のフィールドのいずれか一方に値を指定する必要があります（両方は指定できません）：

* **data**: デコードするデータ。
* **file**: デコードするファイル。

## オプションのパラメータ

* **format**: デコードに使用するフォーマット。使用可能な値は**BASE64**、**HEX**、**HTML**、**JIS**、**QP**、**URL**、**UU**、**YENC** です。デフォルトはBASE64 です。
* **outfile**: デコードしたデータを保存するファイル。これは**UU** デコードではサポートされません。UU デコードでは、エンコードされたファイルに保存されているファイル名が使用されます。
* **outformat**: デコードしたデータに使用するフォーマット。使用可能な値は**RAW**、**BASE64**、**HEX** です。デフォルトはRAW です。
* **encoding**: デコードしたバイト配列をRAW 形式に変換するために使用するエンコード。デフォルトはUTF-8 です。

## アウトプット属性

* **decodeddata**: デコードされたデータ。
* **format**: デコードに使用されたフォーマット。
* **outfile**: **outfile** にインプット値を指定した場合の、デコードされたデータを含むファイル。

## 例

次の{siteNameShort}Script コードは、[Script コネクタ](../../connectors/script)に配置すると、**\[FilePath]** のインプットファイルからBASE64 エンコードされたデータを読み取り、デコードしてからファイルをプッシュします：

```xml theme={null}
<!-- setting the file and encoding format for the input item -->
<arc:set attr="enc.file" value="[FilePath]" />
<arc:set attr="enc.format" value="BASE64" />

<arc:call op="encDecode" in="enc" out="result">
  <!-- setting the output file data to be the decoded data returned from the operation -->
  <arc:set attr="output.data">[result.decodeddata]</arc:set>
</arc:call>

<!-- setting the filename and pushing the file out -->
<arc:set attr="output.filename" value="[FileName]" />
<arc:push item="output" />
```

## 関連リソース

次の記事は、encDecode オペレーションを使用した実際のユースケースです：

* <a href="https://arc.cdata.com/kb/articles/arc-http-signature-auth.rst" target="_blank">HTTP Signature Authentication using CData Arc</a>
