{"id":19651804,"url":"https://github.com/tanaikech/encodeapp","last_synced_at":"2025-07-16T16:32:05.382Z","repository":{"id":79705757,"uuid":"235959670","full_name":"tanaikech/EncodeApp","owner":"tanaikech","description":"EncodeApp is a GAS library for retrieving the encoding set (charset) and doing URL encode with the specific encoding set using Google Apps Script (GAS).","archived":false,"fork":false,"pushed_at":"2021-03-22T05:49:17.000Z","size":6,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T21:49:42.897Z","etag":null,"topics":["charset","developer-tools","gas-library","google-apps-script","library","url-encoding"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanaikech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-24T07:44:48.000Z","updated_at":"2024-09-23T01:50:43.000Z","dependencies_parsed_at":"2023-05-14T20:15:49.986Z","dependency_job_id":null,"html_url":"https://github.com/tanaikech/EncodeApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tanaikech/EncodeApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FEncodeApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FEncodeApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FEncodeApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FEncodeApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanaikech","download_url":"https://codeload.github.com/tanaikech/EncodeApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanaikech%2FEncodeApp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524618,"owners_count":23782011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["charset","developer-tools","gas-library","google-apps-script","library","url-encoding"],"created_at":"2024-11-11T15:08:09.418Z","updated_at":"2025-07-16T16:32:05.366Z","avatar_url":"https://github.com/tanaikech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EncodeApp\r\n\r\n\u003ca name=\"TOP\"\u003e\u003c/a\u003e\r\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENCE)\r\n\r\n\u003ca name=\"Overview\"\u003e\u003c/a\u003e\r\n\r\n# Overview\r\n\r\n**EncodeApp is a GAS library for retrieving the encoding set (charset) and doing URL encode with the specific encoding set using Google Apps Script (GAS).**\r\n\r\n# Library's project key\r\n\r\n```\r\n1DsJdRQ9D6nXgbxVVvOroM3EYJOcB197Isvt2Sl4sziW3m9IqqeB9YoWy\r\n```\r\n\r\n# Methods\r\n\r\n| Methods                                               | Description                                      |\r\n| :---------------------------------------------------- | :----------------------------------------------- |\r\n| [getCharset(blob)](#getcharset)                       | Retrieve the encoding set (charset) of the blob. |\r\n| [encodeURIWithCharset(object)](#encodeuriwithcharset) | URI encode with the specific charset.            |\r\n\r\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\r\n\r\n# Usage:\r\n\r\n## 1. Install library\r\n\r\nIn order to use this library, please install this library as follows.\r\n\r\n1. Create a GAS project.\r\n\r\n   - You can use this library for the GAS project of both the standalone type and the container-bound script type.\r\n\r\n1. [Install EncodeApp library](https://developers.google.com/apps-script/guides/libraries).\r\n\r\n   - Library's project key is **`1DsJdRQ9D6nXgbxVVvOroM3EYJOcB197Isvt2Sl4sziW3m9IqqeB9YoWy`**.\r\n\r\n### About scopes\r\n\r\nThis library use no scopes.\r\n\r\n\u003ca name=\"getcharset\"\u003e\u003c/a\u003e\r\n\r\n## 2. Method: `getCharset`\r\n\r\nIn this method, the encoding set (charset) is retrieved from the blob. The corresponding list of encoding set is from [https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html](https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) is used. **In this case, the returned value is the candidate.** So when you use this method, several charsets are returned as the candidate.\r\n\r\n### Sample script\r\n\r\n```javascript\r\nvar blob = DriveApp.getFileById(\"###\").getBlob();\r\nvar res = EncodeApp.getCharset(blob);\r\nLogger.log(res);\r\n```\r\n\r\nIn this sample script, the charset of the file is retrieved.\r\n\r\n\u003ca name=\"encodeuriwithcharset\"\u003e\u003c/a\u003e\r\n\r\n## 3. Method: `encodeURIWithCharset`\r\n\r\nIn this method, URL encode can be run with the specific charset. At Google Apps Script, when URL encode is run with `encodeURI()` and `encodeURIComponent()`, it is run as `UTF-8`. It seems that this is the specification. In this method, the URL encode can be run by selecting the charset.\r\n\r\n### Sample script\r\n\r\n```javascript\r\nvar object = {\r\n  charset: \"Shift-JIS\",\r\n  text: \"本日は晴天なり\"\r\n};\r\nvar res = EncodeApp.encodeURIWithCharset(object);\r\nLogger.log(res);\r\n```\r\n\r\nIn this sample script, the URL encode is run with `Shift-JIS`. The following result is retrieved.\r\n\r\n```json\r\n{\r\n  \"encodedType1\": \"%96%7B%93%FA%82%CD%90%B0%93%56%82%C8%82%E8\",\r\n  \"encodedType2\": \"%96%7B%93%FA%82%CD%90%B0%93V%82%C8%82%E8\",\r\n  \"blob\": Blob,\r\n  \"charset\": \"Shift-JIS\"\r\n}\r\n```\r\n\r\n`Blob` is the blob with the text of `本日は晴天なり` converted to `Shift-JIS`.\r\n\r\n### Reference:\r\n\r\n- [URL Encode with Shift-JIS using Google Apps Script](https://gist.github.com/tanaikech/f23755d7e024fea9c0f0e036853484d4)\r\n\r\n---\r\n\r\n\u003ca name=\"licence\"\u003e\u003c/a\u003e\r\n\r\n# Licence\r\n\r\n[MIT](LICENCE)\r\n\r\n\u003ca name=\"author\"\u003e\u003c/a\u003e\r\n\r\n# Author\r\n\r\n[Tanaike](https://tanaikech.github.io/about/)\r\n\r\nIf you have any questions and commissions for me, feel free to tell me.\r\n\r\n\u003ca name=\"updatehistory\"\u003e\u003c/a\u003e\r\n\r\n# Update History\r\n\r\n- v1.0.0 (January 24, 2020)\r\n\r\n  1. Initial release.\r\n\r\n[TOP](#top)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanaikech%2Fencodeapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanaikech%2Fencodeapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanaikech%2Fencodeapp/lists"}