{"id":16994656,"url":"https://github.com/znerol/stringprep","last_synced_at":"2025-09-18T08:39:36.715Z","repository":{"id":5429911,"uuid":"6622104","full_name":"znerol/Stringprep","owner":"znerol","description":"PHP implementation of RFC 3454 - Preparation of Internationalized Strings (\"stringprep\")","archived":false,"fork":false,"pushed_at":"2024-07-12T10:42:11.000Z","size":230,"stargazers_count":11,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T00:51:16.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/znerol.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}},"created_at":"2012-11-09T23:22:50.000Z","updated_at":"2019-11-19T12:33:12.000Z","dependencies_parsed_at":"2022-07-06T17:32:00.881Z","dependency_job_id":null,"html_url":"https://github.com/znerol/Stringprep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2FStringprep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2FStringprep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2FStringprep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2FStringprep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znerol","download_url":"https://codeload.github.com/znerol/Stringprep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248521149,"owners_count":21118006,"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":[],"created_at":"2024-10-14T03:46:11.251Z","updated_at":"2025-09-18T08:39:31.661Z","avatar_url":"https://github.com/znerol.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP stringprep\n==============\n\n[![Build Status](https://travis-ci.org/znerol/Stringprep.svg?branch=master)](https://travis-ci.org/znerol/Stringprep)\n\n**Please note that this project is not maintained. It was implemented on a\nweekend and never used in production by the author. If you intend to use it,\nthen please fork it, fix it and then sumbit a pull request updating this\ndocument to point to the proper project.**\n\nThis is a PHP implementation of RFC 3454 - Preparation of Internationalized\nStrings (\"stringprep\").\n\nSee: http://tools.ietf.org/html/rfc3454\n\nRequierements\n-------------\n\n* PHP \u003e= 5.3\n* PHP intl extension (http://ch1.php.net/manual/en/book.intl.php)\n* PHP iconv extension (http://ch1.php.net/manual/en/book.iconv.php)\n\nExample\n-------\n\n```php\n\u003c?php\nrequire \"vendor/autoload.php\";\n\nuse Znerol\\Component\\Stringprep\\Profile;\nuse Znerol\\Component\\Stringprep\\ProfileException;\n\nclass NameprepExampleProfile extends Profile\n{\n  /**\n   * If set to true the characters from RFC3454 table B.1 are removed from the \n   * output.\n   */\n  protected $removeZWS = true;\n\n  /**\n   * One of CASEFOLD_NONE, CASEFOLD_B2, CASEFOLD_B3.\n   */\n  protected $casefold = self::CASEFOLD_B_2;\n\n  /**\n   * Whether to apply string normalization (NFKC)\n   */\n  protected $normalize = self::NORM_NFKC;\n\n  /**\n   * An array of tables from RFC3454 appendix C.\n   */\n  protected $prohibit = array(\n    self::PROHIBIT_C_1_1,\n    self::PROHIBIT_C_1_2,\n    self::PROHIBIT_C_2_1,\n    self::PROHIBIT_C_2_2,\n    self::PROHIBIT_C_3,\n    self::PROHIBIT_C_4,\n    self::PROHIBIT_C_5,\n    self::PROHIBIT_C_6,\n    self::PROHIBIT_C_7,\n    self::PROHIBIT_C_8,\n    self::PROHIBIT_C_9\n  );\n\n  /**\n   * If set, the mechanism for checking bidirectional strings described in RFC3454 \n   * is applied.\n   */\n  protected $checkbidi = true;\n}\n\n$nameprep = new NameprepExampleProfile();\n\ntry {\n    $result = $nameprep-\u003eapply(\"intérnätional-chars\");\n    print(\"+ International characters allowed\\n\");\n}\ncatch (ProfileException $e) {\n    print(\"! Ooops, international characters should be allowed in this profile\\n\");\n}\n\ntry {\n    $result = $nameprep-\u003eapply(\"spaces are not allowed\");\n    print(\"! Ooops, spaces should be prohibited in this profile\\n\");\n}\ncatch (ProfileException $e) {\n    print(\"* Spaces prohibited\\n\");\n}\n```\n\nLicense\n-------\n\nThis software is released under the GNU Lesser General Public License, version 3.0 (LGPL-3.0)\n\nAcknowledgment\n--------------\n\nParts of GNU libidn have been reused in this project:\n* http://www.gnu.org/software/libidn/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznerol%2Fstringprep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznerol%2Fstringprep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznerol%2Fstringprep/lists"}