{"id":18728281,"url":"https://github.com/worthmine/usw","last_synced_at":"2025-11-12T04:30:12.993Z","repository":{"id":56837329,"uuid":"300321582","full_name":"worthmine/usw","owner":"worthmine","description":"usw - use utf8; use strict; use warnings; in one line.","archived":false,"fork":false,"pushed_at":"2023-07-10T08:47:36.000Z","size":106,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T14:16:47.540Z","etag":null,"topics":["perl","pragmas","utf8"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/usw","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worthmine.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T15:07:32.000Z","updated_at":"2023-07-18T09:12:52.000Z","dependencies_parsed_at":"2022-09-10T01:10:42.407Z","dependency_job_id":null,"html_url":"https://github.com/worthmine/usw","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2Fusw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2Fusw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2Fusw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worthmine%2Fusw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worthmine","download_url":"https://codeload.github.com/worthmine/usw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239599076,"owners_count":19665911,"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":["perl","pragmas","utf8"],"created_at":"2024-11-07T14:20:25.377Z","updated_at":"2025-11-12T04:30:12.696Z","avatar_url":"https://github.com/worthmine.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/worthmine/usw.svg?branch=master)](https://travis-ci.com/worthmine/usw) [![Build Status](https://img.shields.io/appveyor/ci/worthmine/usw/master.svg?logo=appveyor)](https://ci.appveyor.com/project/worthmine/usw/branch/master)\n# NAME\n\nusw - use utf8; use strict; use warnings; in one line.\n\n# SYNOPSIS\n\n    use usw; # is just 8 bytes pragma instead of below:\n    use utf8;\n    use strict;\n    use warnings;\n    my $cp = '__YourCP__' || 'UTF-8';\n    binmode \\*STDIN,  ':encoding($cp)';\n    binmode \\*STDOUT, ':encoding($cp)';\n    binmode \\*STDERR, ':encoding($cp)';\n     \n\n# DESCRIPTION\n\nusw is like a shortcut pragma that works in any environment.\n\nMay be useful for those who write the above code every single time.\n\n## HOW TO USE\n\n    use usw;\n\nIt seems a kind of pragmas but doesn't spent\n[%^H](https://metacpan.org/pod/perlpragma#Key-naming)\nbecause overusing it is nonsense.\n\n`use usw;` should be just the very shortcut at beginning of your codes.\n\nTherefore, if you want to set `no`, you should do it the same way as before.\n\n    no strict;\n    no warnings;\n    no utf8;\n\nThese still work as expected everywhere.\n\nAnd writing like this doesn't work.\n\n    no usw;\n\nSince version 0.12, it dies with warning.\n\n## Automatically repairs bugs around file path which is encoded\n\nIt replaces `$SIG{__WARN__}` or/and `$SIG{__DIE__}`\nto avoid the bug(This may be a strange specification)\nof encoding only the file path like that:\n\n    宣言あり at t/script/00_è­¦åãã.pl line 19.\n\n## features\n\nSince version 0.07, you can relate automatically\n`STDIN`,`STDOUT`,`STDERR` with `cp\\d+`\nwhich is detected by [Win32](https://metacpan.org/pod/Win32) module.\n\nSince version 0.08, you don't have to care if the environment is a Windows or not.\n\n# SEE ALSO\n\n- [Encode](https://metacpan.org/pod/Encode)\n- [binmode](https://perldoc.perl.org/functions/binmode)\n- [%SIG](https://perldoc.perl.org/variables/%25SIG)\n- [Win32](https://metacpan.org/pod/Win32)\n- [open](https://metacpan.org/pod/open)\n\n# LICENSE\n\nCopyright (C) worthmine.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nYuki Yoshida([worthmine](https://github.com/worthmine))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworthmine%2Fusw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworthmine%2Fusw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworthmine%2Fusw/lists"}