{"id":26674114,"url":"https://github.com/yaaama/escapec","last_synced_at":"2026-04-27T21:32:14.252Z","repository":{"id":281554327,"uuid":"945627799","full_name":"yaaama/escapec","owner":"yaaama","description":"Escaping text for use in C and C++","archived":false,"fork":false,"pushed_at":"2025-03-09T21:20:48.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T02:17:27.313Z","etag":null,"topics":["c","shell","string","tool"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yaaama.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":"2025-03-09T21:12:05.000Z","updated_at":"2025-03-09T21:22:46.000Z","dependencies_parsed_at":"2025-03-09T22:21:18.835Z","dependency_job_id":"396ce85a-a3b7-4da5-a329-0f894681b25b","html_url":"https://github.com/yaaama/escapec","commit_stats":null,"previous_names":["yaaama/escapec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yaaama/escapec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaaama%2Fescapec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaaama%2Fescapec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaaama%2Fescapec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaaama%2Fescapec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yaaama","download_url":"https://codeload.github.com/yaaama/escapec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yaaama%2Fescapec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["c","shell","string","tool"],"created_at":"2025-03-26T02:17:29.937Z","updated_at":"2026-04-27T21:32:14.236Z","avatar_url":"https://github.com/yaaama.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `escapec`\n\n## About\n\nWhen we want to define a string literal in C/C++, we need to ensure that the\ntext is properly escaped.\n\n**This tool is made for that purpose.**\n\n## Usage\n\n### Piping input\n\nYou can pipe input like so:\n\n```shell\n$ echo -n 'some%random\"badtext' | escapec\n```\n\nWhich produces:\n\n\u003e \"some%%random\\\"badtext\"\n\nWhich you can use in C code, like so:\n\n```c\nchar *good_text = \"some%%random\\\"badtext\";\n```\n\nNote that there are now _2_ `%` characters. To print `%`, you must escape it with with another.\n\nBy default it is escaped, however you may turn it off using the `-p` flag.\n\n### Specifying a file to read from\n\nYou can also specify a file like so:\n\n```shell\n$ escapec json.txt\n```\n\nWhich will print the result to standard output.\n\nIf you want to capture the output and store it in another file, it is a trivial task:\n\n```shell\n$ escapec json.txt \u003e escaped_json.txt\n```\n\n### Flags and Options\n\n- **-p** `escapec` will not escape away `%` characters.\n- **-n** Terminate `escapec` output using a null terminator rather than with a new line.\n- **-s** Break output on new-line(s). This is useful if you want to retain the\n  line-breaks present in the original text.\n- **-h** Prints an explanation of the options above.\n\n## Building\n\n1. Clone the repository.\n\n```shell\ngit clone https://github.com/yaaama/escapec.git\n```\n\n2. Enter the cloned repository.\n\n```shell\ncd escapec\n```\n\n3. Make it.\n\n```shell\nmake\n```\n\n4. You can then copy the script to your local scripts folder (typically\n   `$HOME/.local/bin/`):\n\n```shell\ncp ./escapec $HOME/.local/bin/\n```\n\n---\n\n## Note\n\nIf there are any issues with the code or you find any bugs, I encourage you to\ncreate an issue and I will do my best to look into it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaaama%2Fescapec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyaaama%2Fescapec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyaaama%2Fescapec/lists"}