{"id":17681194,"url":"https://github.com/arcage/crystal-quotedprintable","last_synced_at":"2025-07-05T06:37:06.733Z","repository":{"id":76228634,"uuid":"100150096","full_name":"arcage/crystal-quotedprintable","owner":"arcage","description":"Quoted-printable handling module for Crystal","archived":false,"fork":false,"pushed_at":"2021-05-27T23:24:04.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T21:41:03.420Z","etag":null,"topics":["crystal","quoted-printable"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/arcage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-08-13T02:57:52.000Z","updated_at":"2021-05-27T23:22:22.000Z","dependencies_parsed_at":"2023-03-11T21:59:37.937Z","dependency_job_id":null,"html_url":"https://github.com/arcage/crystal-quotedprintable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcage%2Fcrystal-quotedprintable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcage%2Fcrystal-quotedprintable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcage%2Fcrystal-quotedprintable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arcage%2Fcrystal-quotedprintable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arcage","download_url":"https://codeload.github.com/arcage/crystal-quotedprintable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365650,"owners_count":20765548,"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":["crystal","quoted-printable"],"created_at":"2024-10-24T09:10:28.809Z","updated_at":"2025-03-30T19:14:16.113Z","avatar_url":"https://github.com/arcage.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quoted Printable for Crystal\n\nThe `QuotedPrintable` module provides for the encoding (`#encode`) and decoding (`#decode`, `#decode_string`) of binary data using a base64 representation.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  quoted_printable:\n    github: arcage/crystal-quotedprintable\n```\n\n## Usage\n\n```crystal\nrequire \"quoted_printable\"\n\ndata = \u003c\u003c-HTM\n\u003chtml lang=\\\"ja\\\"\u003e\n\u003chead\u003e\n  \u003ctitle\u003e日本語タイトル\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003ch1\u003e見出し\u003c/h1\u003e\n  \u003cp\u003e本文\u003cp\u003e\n\u003c/body\u003e\n\u003c/html\u003e\nHTM\n\nencoded = QuotedPrintable.encode(data)\n# =\u003e \u003chtml lang=3D\"ja\"\u003e\n#    \u003chead\u003e\n#      \u003ctitle\u003e=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB\u003c/t=\n#    itle\u003e\n#    \u003c/head\u003e\n#    \u003cbody\u003e\n#      \u003ch1\u003e=E8=A6=8B=E5=87=BA=E3=81=97\u003c/h1\u003e\n#      \u003cp\u003e=E6=9C=AC=E6=96=87\u003cp\u003e\n#    \u003c/body\u003e\n#    \u003c/html\u003e\n\ndecoded = QuotedPrintable.decode_string(encoded)\n#=\u003e \u003chtml lang=\"ja\"\u003e\n#    \u003chead\u003e\n#      \u003ctitle\u003e日本語タイトル\u003c/title\u003e\n#    \u003c/head\u003e\n#    \u003cbody\u003e\n#      \u003ch1\u003e見出し\u003c/h1\u003e\n#      \u003cp\u003e本文\u003cp\u003e\n#    \u003c/body\u003e\n#    \u003c/html\u003e\n```\n\nAn argument of the `#encode` can be `String` or `Enumerable(UInt8)`(eg. `Bytes`, `Array(UInt8)`, `Tuple(UInt8)`) .\n\nWhen the `String` object is given, it will be encoded as a text. That means it will be encoded with literal representation, and all line breaks in it will be represented as a CRLF sequence.\n\nWhen the `Enumerable(UInt8)` object is given, all bytes wil be encoded as it is.\n\nIn case of the encoding as a text, even if original data was written with LF line breaks, all line breaks in decoded data will be CRLF. To avoid this, you can specify the line break code with `line_break:` argument of `#decode_string` method.\n\n```crystal\n# decode with LF line breaks\ndecoded = QuotedPrintable.decode_string(encoded, line_break: \"\\n\")\n```\n\nTo decode non-utf-8 text, you can specify the `encoding:` and `invalid:` arguments, same as those of the some methods of `String`.\n\n```crystal\n# decode from Shift JIS text\ndecoded = QuotedPrintable.decode_string(encoded, encoding: \"Shift_JIS\", invalid: :skip)\n```\n\n## Contributors\n\n- [ʕ·ᴥ·ʔAKJ](https://github.com/arcage) - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcage%2Fcrystal-quotedprintable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farcage%2Fcrystal-quotedprintable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcage%2Fcrystal-quotedprintable/lists"}