URL エンコード文字列, UriComponent デコード
URL エンコード文字列, UriComponent デコード (UrlEncoded String, Decode UriComponent)
URLエンコードされた文字列(URIのコンポーネント部)をデコードします。”5%25off%3F” は “5%off?” に、”%E3%81%82%20%E3%81%84″ は “あ い” に、デコードされます。
Configs
  • A1: URLエンコードされた文字列をセットしてください (例 “5%25off%3F” ) *#{EL}
  • B1: デコードされた文字列が格納される文字列型データ項目を選択してください (更新) *
Script (click to open)
// GraalJS Script (engine type: 2)

//////// START "main()" /////////////////////////////////////////////////////////////////
main();
function main(){ 

//// == Config Retrieving / 工程コンフィグの参照 ==
const strEncoded       = configs.get( "StrConfA1" );          // REQUIRED
  if( strEncoded     === "" ){
    engine.log( " AutomatedTask ConfigWarning:" +
                " Config {A1: URL-Encoded String} is empty \n" );
  }
const strPocketDecoded = configs.getObject( "SelectConfB1" ); // REQUIRED


//// == Data Retrieving / ワークフローデータの参照 ==
// (Nothing. Retrieved via Expression Language in Config Retrieving)


//// == Calculating / 演算 ==
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent
let strDecoded = decodeURIComponent( strEncoded );


//// == Data Updating / ワークフローデータへの代入 ==
engine.setData( strPocketDecoded, strDecoded );

} //////// END "main()" /////////////////////////////////////////////////////////////////



/*
Notes:
- Many characters are URL-encoded in the URI.
    - The exceptions: A-Z a-z 0-9 - _ . ! ~ * ' ( )
- For application/x-www-form-urlencoded, spaces are to be replaced by +
    - But decodeURIComponent () does not replace "+" with a space.
    - "%20" will be decoded into a space.

Notes-ja:
- URI 部では、多くの文字が URL エンコード(エスケープ)されます。
    - 例外: A-Z a-z 0-9 - _ . ! ~ * ' ( )
- application/x-www-form-urlencoded では、スペースは + に置換されます。
    - しかし decodeURIComponent() は "+" をスペースに置換しません。
    - "%20" はスペースにデコードされます。
*/

/*
APPENDIX
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI

APPENDIX-ja
- https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent
- https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/decodeURI
*/

Download

2021-04-03 (C) Questetra, Inc. (MIT License)
https://support.questetra.com/ja/addons/urlencoded-string-decode-uricomponent/
Addonファイルのインポートは Professional でのみご利用いただけます

Notes

  • URI 部では、多くの文字が URL エンコード(エスケープ)されます。
    • 例外: A-Z a-z 0-9 – _ . ! ~ * ‘ ( )
  • application/x-www-form-urlencoded では、スペースは + に置換されます。
    • しかし decodeURIComponent() は “+” をスペースに置換しません。
    • “%20” はスペースにデコードされます。

Capture

URLエンコードされた文字列(URIのコンポーネント部)をデコードします。"5%25off%3F" は "5%off?" に、"%E3%81%82%20%E3%81%84" は "あ い" に、デコードされます。URI 全体のデコードには

Appendix

See also

コメントを残す

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

%d人のブロガーが「いいね」をつけました。