Search Results
Canonicalizes the passed locale string to ICU format. This does not necessarily indicate or return a valid locale. It is only a version of the input that has been canonicalized according to ICU rules. The behavior of this function depends on the version of ICU PHP is using (INTL_ICU_VERSION).
The 'Locale::canonicalize' function is used in PHP to canonicalize a given locale string. Canonicalization involves normalizing the locale string to a standardized format, ensuring consistency and compatibility across different systems and applications. It removes any irregularities, inconsistencies, or redundant information from the locale string.
Locales cannot be instantiated as objects. All of the functions/methods provided are static. The null or empty string obtains the "root" locale. The "root" locale is equivalent to "en_US_POSIX" in CLDR. Language tags (and thus locale identifiers) are case insensitive. There exists a canonicalization function to make case match the specification.
This does not necessarily indicate or return a valid locale. It is only a version of the input that has been canonicalized according to ICU rules.
Locale::canonicalize locale_canonicalize (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)
The Locale class Introduction A "Locale" is an identifier used to get language, culture, or regionally-specific behavior from an API. PHP locales are organized and identified the same way that the CLDR locales used by ICU (and many vendors of Unix-like operating systems, the Mac, Java, and so forth) use.
Oct 31, 2017 · The canonicalize() function takes a locale string as an argument, not an arbitrary length stream of characters. The PHP source in ext/intl/intl_data.h defines the maximum length of a locale string to be 80 characters:
