Ubuntu Tutorial

How To Install php-patchwork-utf8 on Ubuntu

Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes  • 595 words

Introduction

In this tutorial we learn how to install php-patchwork-utf8 on Ubuntu.

What is php-patchwork-utf8

php-patchwork-utf8 is:

Patchwork UTF-8 provides both a portability layer for mbstring, iconv, and intl Normalizer and grapheme_* functions, and an UTF-8 grapheme clusters aware replica of native string functions.

Patchwork UTF-8 provides pure PHP implementations for mbstring, iconv, and intl. The following set of portability-fallbacks allows an application to run on a server even if one or more of those extensions are not enabled:

The Patchwork\Utf8 class implements the quasi-complete set of native string functions that need UTF-8 grapheme clusters awareness. Function names, arguments and behavior carefully replicates native PHP string functions.

Some more functions are also provided to help handling UTF-8 strings:

Mirrored string functions are: strlen, substr, strpos, stripos, strrpos, strripos, strstr, stristr, strrchr, strrichr, strtolower, strtoupper, wordwrap, chr, count_chars, ltrim, ord, rtrim, trim, str_ireplace, str_pad, str_shuffle, str_split, str_word_count, strcmp, strnatcmp, strcasecmp, strnatcasecmp, strncasecmp, strncmp, strcspn, strpbrk, strrev, strspn, strtr, substr_compare, substr_count, substr_replace, ucfirst, lcfirst, ucwords, number_format, utf8_encode, utf8_decode, json_decode, filter_input, filter_input_array.

There are three methods to install php-patchwork-utf8 on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install php-patchwork-utf8 Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install php-patchwork-utf8 using apt-get by running the following command:

sudo apt-get -y install php-patchwork-utf8

Install php-patchwork-utf8 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install php-patchwork-utf8 using apt by running the following command:

sudo apt -y install php-patchwork-utf8

Install php-patchwork-utf8 Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install php-patchwork-utf8 using aptitude by running the following command:

sudo aptitude -y install php-patchwork-utf8

How To Uninstall php-patchwork-utf8 on Ubuntu

To uninstall only the php-patchwork-utf8 package we can use the following command:

sudo apt-get remove php-patchwork-utf8

Uninstall php-patchwork-utf8 And Its Dependencies

To uninstall php-patchwork-utf8 and its dependencies that are no longer needed by Ubuntu, we can use the command below:

sudo apt-get -y autoremove php-patchwork-utf8

Remove php-patchwork-utf8 Configurations and Data

To remove php-patchwork-utf8 configuration and data from Ubuntu we can use the following command:

sudo apt-get -y purge php-patchwork-utf8

Remove php-patchwork-utf8 configuration, data, and all of its dependencies

We can use the following command to remove php-patchwork-utf8 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge php-patchwork-utf8

Dependencies

php-patchwork-utf8 have the following dependencies:

References

Summary

In this tutorial we learn how to install php-patchwork-utf8 package on Ubuntu using different package management tools: apt, apt-get and aptitude.

Follow us

We provides various tutorials about Ubuntu