lstrojny/uffff

Unicode input processing made trivial

v0.2.0 2024-01-22 15:10 UTC

This package is auto-updated.

Last update: 2024-05-02 18:34:36 UTC


README

CI Documentation Status

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 more

With Uffff the problem is reduced to:

$good = Uffff\unicode($bad);

Read the docs to learn more.

Development

Setting up the environment

Uffff uses direnv 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.