0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

40 代おっさん GASのグローバル関数について学ぶ

Posted at

本記事ついて

本記事は プログラミング初学者の私が学習していく中でわからない単語や概要をなるべくわかりやすい様にまとめたものです。
もし誤りなどありましたらコメントにてお知らせいただけるとありがたいです。

グローバル関数

グローバル関数とは
JavaScriptの組み込みオブジェクトに含まれず、かつどこからでも呼び出せる関数のこと

分類 メンバー 戻り値 説明
グローバル関数 encodeURI(uri) String URI文字列uriをURIコンコードして返す
グローバル関数 encodeURIComponent(str) String 文字列strをURIコンコードして返す
グローバル関数 decodeURI(uri) String URI文字列uriをURIデコードして返す
グローバル関数 decodeURIComponent(str) String 文字列strをURIデコードして返す

URIエンコードとURIでコード

漢字、ひらがななどはURIの構成文字として使用制限がある。これらを使うには、制限されていない文字に変換する必要がある。
その変換処理をURIエンコードと言い、URIエンコードされたURIを復元する処理をURIデコードと言う。

function toshiki4() {
  const str = '利樹';
  console.log(encodeURI(str));
  console.log(encodeURIComponent(str));  

  const uri = 'https://www.google.co.jp/search?q=利樹';
  console.log(encodeURI(uri));
  console.log(encodeURIComponent(uri));
}

参考資料

https://www.amazon.co.jp/s?k=google+apps+script+%E5%AE%8C%E5%85%A8%E5%85%A5%E9%96%80&adgrpid=110264232688&gclid=CjwKCAiA9aKQBhBREiwAyGP5lSl7AJJLCvOEHb4wQgMlyqW1fll5X8GDTT_Rkd1_soUAyIPMXQr26hoClHEQAvD_BwE&hvadid=553833563682&hvdev=c&hvlocphy=1009076&hvnetw=g&hvqmt=b&hvrand=4378489642044417389&hvtargid=kwd-594191211348&hydadcr=4106_13159878&jp-ad-ap=0&tag=googhydr-22&ref=pd_sl_2x1owglv0s_b_p52

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?