Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

normalizer_is_normalized(3) [php man page]

NORMALIZER_IS_NORMALIZED(3)						 1					       NORMALIZER_IS_NORMALIZED(3)

Normalizer::isNormalized - Checks if the provided string is already in the specified normalization form.

       Object oriented style

SYNOPSIS
publicstatic bool Normalizer::isNormalized (string $input, [string $form = Normalizer::FORM_C]) DESCRIPTION
Procedural style bool normalizer_is_normalized (string $input, [string $form = Normalizer::FORM_C]) Checks if the provided string is already in the specified normalization form. PARAMETERS
o $input -The input string to normalize o $form - One of the normalization forms. RETURN VALUES
TRUE if normalized, FALSE otherwise or if there an error EXAMPLES
Example #1 normalizer_is_normalized(3) example <?php $char_A_ring = "xC3x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "xCCx8A"; // 'COMBINING RING ABOVE' (U+030A) $char_orig = 'A' . $char_combining_ring_above; $char_norm = normalizer_normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo ( normalizer_is_normalized($char_orig, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; echo '; '; echo ( normalizer_is_normalized($char_norm, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; ?> Example #2 OO example <?php $char_A_ring = "xC3x85"; // 'LATIN CAPITAL LETTER A WITH RING ABOVE' (U+00C5) $char_combining_ring_above = "xCCx8A"; // 'COMBINING RING ABOVE' (U+030A) $char_orig = 'A' . $char_combining_ring_above; $char_norm = Normalizer::normalize( 'A' . $char_combining_ring_above, Normalizer::FORM_C ); echo ( Normalizer::isNormalized($char_orig, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; echo '; '; echo ( Normalizer::isNormalized($char_norm, Normalizer::FORM_C) ) ? "normalized" : "not normalized"; ?> The above example will output: not normalized; normalized SEE ALSO
normalizer_normalize(3). PHP Documentation Group NORMALIZER_IS_NORMALIZED(3)

Check Out this Related Man Page

unicode(n)						       Unicode normalization							unicode(n)

__________________________________________________________________________________________________________________________________________________

NAME
unicode - Implementation of Unicode normalization SYNOPSIS
package require Tcl 8.3 package require unicode 1.0 ::unicode::fromstring string ::unicode::tostring uclist ::unicode::normalize form uclist ::unicode::normalizeS form string _________________________________________________________________ DESCRIPTION
This is an implementation in Tcl of the Unicode normalization forms. COMMANDS
::unicode::fromstring string Converts string to list of integer Unicode character codes which is used in unicode for internal string representation. ::unicode::tostring uclist Converts list of integers uclist back to Tcl string. ::unicode::normalize form uclist Normalizes Unicode characters list ulist according to form and returns the normalized list. Form form takes one of the following values: D (canonical decomposition), C (canonical decomposition, followed by canonical composition), KD (compatibility decomposi- tion), or KC (compatibility decomposition, followed by canonical composition). ::unicode::normalizeS form string A shortcut to ::unicode::tostring [unicode::normalize $form [::unicode::fromstring $string]]. Normalizes Tcl string and returns normalized string. EXAMPLES
% ::unicode::fromstring "u0410u0411u0412u0413" 1040 1041 1042 1043 % ::unicode::tostring {49 50 51 52 53} 12345 % % ::unicode::normalize D {7692 775} 68 803 775 % ::unicode::normalizeS KD "u1d2c" A % REFERENCES
[1] "Unicode Standard Annex #15: Unicode Normalization Forms", (http://unicode.org/reports/tr15/) AUTHORS
Sergei Golovan BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category string- prep of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
stringprep(n) KEYWORDS
normalization, unicode COPYRIGHT
Copyright (c) 2007, Sergei Golovan <sgolovan@nes.ru> stringprep 1.0.0 unicode(n)
Man Page