A set of dependency-free basic internationalization tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
J. King c4a2ae1714 Tests for new features 4 years ago
lib Add label matcher 4 years ago
perf Style fixes 6 years ago
tests Tests for new features 4 years ago
tools Add label matcher 4 years ago
vendor-bin Upgrade to PHPUnit 8 4 years ago
.gitattributes Initial commit with a few states; not yet tested 6 years ago
.gitignore Upgrade to PHPUnit 8 4 years ago
.php_cs.dist Style fixes 6 years ago
AUTHORS Split off UTF-8 tools from URL parser 6 years ago
CHANGELOG Restore changelog 4 years ago
LICENSE Split off UTF-8 tools from URL parser 6 years ago
README.md Full tests for EUC-KR 6 years ago
RoboFile.php Tooling update 4 years ago
composer.json Refactor tests 6 years ago
composer.lock Tooling update 4 years ago
robo Tooling update 4 years ago
robo.bat Add infrstructure required for tests 6 years ago

README.md

Dependency-free internationalization tools for PHP

While PHP's internationalization extension offers excellent and extensive functionality for dealing with human languages, character encodings, and various related things, it is not always available. Moreover, its character decoder does not yield the same results as WHATWG's Encoding standard, making it unsuitable for implementing parsers for URLs or HTML. The more widely used multi-byte string extension not only suffers the same problems, but is also very slow.

Included here is a partial suite of WHATWG-compatible seekable string decoders which are reasonably performant while requiring no external dependencies or PHP extensions. At present it includes the following encodings:

  • UTF-8
  • UTF-16
  • gb18030
  • GBK
  • Big5
  • EUC-KR
  • all single-byte encodings
  • x-user-defined

Where applicable, code point encoders are also included. In time it will be extended to cover the entire suite of WHATWG character encodings, and may also provide other character-centric internationalization functionality.