https://github.com/lstrojny/uffff
Unicode input processing made trivial
https://github.com/lstrojny/uffff
php security text unicode
Last synced: 2 months ago
JSON representation
Unicode input processing made trivial
- Host: GitHub
- URL: https://github.com/lstrojny/uffff
- Owner: lstrojny
- License: mit
- Created: 2023-03-15T08:00:53.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-21T18:43:39.000Z (10 months ago)
- Last Synced: 2025-03-27T09:21:19.510Z (3 months ago)
- Topics: php, security, text, unicode
- Language: PHP
- Homepage:
- Size: 622 KB
- Stars: 20
- Watchers: 3
- Forks: 1
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Uffff - _Unicode input processing made trivial_!
[](https://github.com/lstrojny/uffff/actions/workflows/ci.yml) [](https://uffff.readthedocs.io/en/latest/?badge=latest)
Properly processing unicode user input is surprisingly tricky:
- Ensuring bidirectional markers are balanced properly
- Trimming whitespaces and handling esoteric unicode whitespaces well
- Normalizing unicode equivalent characters to a well-known form
- Harmonizing newlines to a single format
- … and moreWith **Uffff** the problem is reduced to:
```php
$good = Uffff\unicode($bad);
```[Read the docs](https://uffff.readthedocs.io/) to learn more.
## Development
### Setting up the environment
_Uffff_ uses [direnv](https://direnv.net/) to set up the development environment. Run `direnv allow` to initialize the
development environment.To switch to a different PHP version for development or if you prefer not to use direnv, you can use `nix develop` to
initialize the environment:- `nix develop github:loophp/nix-shell#env-php82 --impure` to select PHP 8.2
- `nix develop github:loophp/nix-shell#env-php83 --impure` to select PHP 8.3
- `nix develop github:loophp/nix-sphinx` to set up sphinx to build documentation### Making changes
Change the code and then run `composer check` to run tests, static inspection, everything and the kitchen sink. Once
that succeeds, open a pull request.Edit the documentation in `docs/` and run `composer docs` to build the documentation. Open `build/docs/html/index.html`
in a browser to view the HTML version.