---
schema_version: "1"
id: 3749bfafe09b3696a44d79a3dba9f200ee408664180e2ba93731178341e83855
title: encodeURI
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-url-functions-encodeuri.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-url-functions-encodeuri
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8b1022e93c5e3cf208e77db4146f8826429bdd9ecd01d60abb4f9ae186820993
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# encodeURI

## [](#encodeuri1)encodeURI(text: String): String

UTF-8 エスケープシーケンスを使用して URI をエンコードします。

2 つのサロゲート文字で構成される文字に最大 4 つのエスケープシーケンスを適用します。この関数は、URI が完全な URI であることを前提にしているため、特別な意味を持つ予約文字はエンコードしません。

この関数では、次の文字は UTF-8 エスケープシーケンスによって​_エンコードされません_​。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">種別 (エスケープされない)</th>
<th class="tableblock halign-left valign-top">例</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">予約文字</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">; , / ? : @ &amp; = $</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">エスケープされない文字</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">アルファベット、10 進数、- _ . ! ~ * ' ( )</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">番号記号</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">#</p></td>
</tr>
</tbody>
</table>

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">エンコードする URI。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例は、1 つの URL 内のスペースのエンコードと、​`not_encoded`​ 文字列でエンコードされない文字のリストを示しています。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import * from dw::core::URL
output application/json
---
{
    "encodeURI" : encodeURI("http://asd/ text to decode /text"),
    "not_encoded": encodeURI("http://:;,/?:@&=\$_-_.!~*'()")
}
```

#### [](#出力)出力

```JSON
{
   "encodeURI": "http://asd/%20text%20to%20decode%20/%25/\"\'/text",
   "not_encoded": "http://:;,/?:@&=$_-_.!~*'()"
}
```