Download the PHP package kit-jotform/php-ftfy without Composer

On this page you can find all versions of the php package kit-jotform/php-ftfy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-ftfy

php-ftfy: fixes text for you

A PHP 8.1+ text-fixing library based on the Python ftfy library (version 6.3.1) by Robyn Speer.

What it does

ftfy fixes mojibake — text that was encoded in UTF-8 but decoded as something else (Windows-1252, Latin-1, etc.), producing garbled characters.

Installing

Requirements: PHP >= 8.1, ext-mbstring, ext-intl

Usage

Ftfy::fixText(string $text, ?TextFixerConfig $config = null): string

Fix all encoding issues in a string.

Ftfy::fixEncoding(string $text): string

Fix only encoding/mojibake issues, without applying other text fixes.

Ftfy::needsFix(string $text, ?TextFixerConfig $config = null): bool

Fast dry-run that checks whether text needs fixing without performing corrections. Use as a gate before fixText() on hot paths — 10-26x faster depending on input.

Respects TextFixerConfig — disabled fixers are skipped:

Ftfy::fixAndExplain(string $text, ?TextFixerConfig $config = null): array

Returns ['text' => string, 'explanation' => array] with the fixed text and a list of changes made.

Configuration

Use $config->with(uncurlQuotes: false) to produce a modified copy.

Note on large inputs: Internally, regex matching uses chunked processing for inputs larger than 8 KB to avoid hitting PCRE backtracking/recursion limits. No configuration is needed — this is handled automatically.

Command-line usage

A CLI script is included at bin/ftfy.

Fix a string directly:

Pipe from stdin:

Fix a file:

Show what was fixed (explanation goes to stderr):

Check if text needs fixing (exit code 1 = needs fix):

Override config options with -c key=value (repeatable):

Fix mojibake inside a JSON file with -j (minimal-diff: only changes string values that contain mojibake; preserves whitespace, key order, and untouched escapes):

When mojibake lives inside JSON string values, the raw file contains only ASCII escape sequences like —, so plain php bin/ftfy --needs-fix broken.json reports false — the mojibake bytes only appear after JSON decoding. -j walks the JSON byte-by-byte (no regex, no PCRE recursion limits), decodes each string literal individually, and rewrites only those that needsFix flags. Other strings and all structural bytes pass through verbatim.

-j composes with -n and -e:

Install globally (optional):

Options:

Option Short Description
--explain -e Print what was fixed (to stderr)
--needs-fix -n Print true/false; exit 0 if no fix needed, 1 if fix needed
--json -j Fix mojibake inside JSON string values (minimal-diff output; composes with -n and -e)
--file -f Read input from a file
--config key=val -c Set a TextFixerConfig option (repeatable)
--help -h Show help

Boolean config keys accept true/false/1/0: uncurlQuotes, fixEncoding, fixLineBreaks, fixSurrogates, removeControlChars, removeTerminalEscapes, restoreByteA0, replaceLossySequences, decodeInconsistentUtf8, fixC1Controls, fixLatinLigatures, fixCharacterWidth. String keys: unescapeHtml (auto/true/false), normalization (NFC/NFKC/null), maxDecodeLength (integer).

Running tests

Credits


All versions of php-ftfy with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-mbstring Version *
ext-intl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kit-jotform/php-ftfy contains the following files

Loading the files please wait ...