{
    "mode": "perldoc",
    "parameter": "Unicode::UCD",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Unicode%3A%3AUCD/json",
    "generated": "2026-05-30T19:05:20Z",
    "synopsis": "use Unicode::UCD 'charinfo';\nmy $charinfo   = charinfo($codepoint);\nuse Unicode::UCD 'charprop';\nmy $value  = charprop($codepoint, $property);\nuse Unicode::UCD 'charpropsall';\nmy $allvalueshashref = charpropsall($codepoint);\nuse Unicode::UCD 'casefold';\nmy $casefold = casefold($codepoint);\nuse Unicode::UCD 'allcasefolds';\nmy $allcasefoldsref = allcasefolds();\nuse Unicode::UCD 'casespec';\nmy $casespec = casespec($codepoint);\nuse Unicode::UCD 'charblock';\nmy $charblock  = charblock($codepoint);\nuse Unicode::UCD 'charscript';\nmy $charscript = charscript($codepoint);\nuse Unicode::UCD 'charblocks';\nmy $charblocks = charblocks();\nuse Unicode::UCD 'charscripts';\nmy $charscripts = charscripts();\nuse Unicode::UCD qw(charscript charinrange);\nmy $range = charscript($script);\nprint \"looks like $script\\n\" if charinrange($range, $codepoint);\nuse Unicode::UCD qw(generalcategories biditypes);\nmy $categories = generalcategories();\nmy $types = biditypes();\nuse Unicode::UCD 'propaliases';\nmy @spacenames = propaliases(\"space\");\nuse Unicode::UCD 'propvaluealiases';\nmy @gcpunctnames = propvaluealiases(\"Gc\", \"Punct\");\nuse Unicode::UCD 'propvalues';\nmy @allEAshortnames = propvalues(\"EastAsianWidth\");\nuse Unicode::UCD 'propinvlist';\nmy @puncts = propinvlist(\"gc=punctuation\");\nuse Unicode::UCD 'propinvmap';\nmy ($listref, $mapref, $format, $missing)\n= propinvmap(\"General Category\");\nuse Unicode::UCD 'searchinvlist';\nmy $index = searchinvlist(\\@invlist, $codepoint);\n# The following function should be used only internally in\n# implementations of the Unicode Normalization Algorithm, and there\n# are better choices than it.\nuse Unicode::UCD 'compexcl';\nmy $compexcl = compexcl($codepoint);\nuse Unicode::UCD 'namedseq';\nmy $namedseq = namedseq($namedsequencename);\nmy $unicodeversion = Unicode::UCD::UnicodeVersion();\nmy $converttonumeric =\nUnicode::UCD::num(\"\\N{RUMI DIGIT ONE}\\N{RUMI DIGIT TWO}\");",
    "sections": {
        "NAME": {
            "content": "Unicode::UCD - Unicode character database\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Unicode::UCD 'charinfo';\nmy $charinfo   = charinfo($codepoint);\n\nuse Unicode::UCD 'charprop';\nmy $value  = charprop($codepoint, $property);\n\nuse Unicode::UCD 'charpropsall';\nmy $allvalueshashref = charpropsall($codepoint);\n\nuse Unicode::UCD 'casefold';\nmy $casefold = casefold($codepoint);\n\nuse Unicode::UCD 'allcasefolds';\nmy $allcasefoldsref = allcasefolds();\n\nuse Unicode::UCD 'casespec';\nmy $casespec = casespec($codepoint);\n\nuse Unicode::UCD 'charblock';\nmy $charblock  = charblock($codepoint);\n\nuse Unicode::UCD 'charscript';\nmy $charscript = charscript($codepoint);\n\nuse Unicode::UCD 'charblocks';\nmy $charblocks = charblocks();\n\nuse Unicode::UCD 'charscripts';\nmy $charscripts = charscripts();\n\nuse Unicode::UCD qw(charscript charinrange);\nmy $range = charscript($script);\nprint \"looks like $script\\n\" if charinrange($range, $codepoint);\n\nuse Unicode::UCD qw(generalcategories biditypes);\nmy $categories = generalcategories();\nmy $types = biditypes();\n\nuse Unicode::UCD 'propaliases';\nmy @spacenames = propaliases(\"space\");\n\nuse Unicode::UCD 'propvaluealiases';\nmy @gcpunctnames = propvaluealiases(\"Gc\", \"Punct\");\n\nuse Unicode::UCD 'propvalues';\nmy @allEAshortnames = propvalues(\"EastAsianWidth\");\n\nuse Unicode::UCD 'propinvlist';\nmy @puncts = propinvlist(\"gc=punctuation\");\n\nuse Unicode::UCD 'propinvmap';\nmy ($listref, $mapref, $format, $missing)\n= propinvmap(\"General Category\");\n\nuse Unicode::UCD 'searchinvlist';\nmy $index = searchinvlist(\\@invlist, $codepoint);\n\n# The following function should be used only internally in\n# implementations of the Unicode Normalization Algorithm, and there\n# are better choices than it.\nuse Unicode::UCD 'compexcl';\nmy $compexcl = compexcl($codepoint);\n\nuse Unicode::UCD 'namedseq';\nmy $namedseq = namedseq($namedsequencename);\n\nmy $unicodeversion = Unicode::UCD::UnicodeVersion();\n\nmy $converttonumeric =\nUnicode::UCD::num(\"\\N{RUMI DIGIT ONE}\\N{RUMI DIGIT TWO}\");\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Unicode::UCD module offers a series of functions that provide a\nsimple interface to the Unicode Character Database.\n\ncode point argument\nSome of the functions are called with a *code point argument*, which is\neither a decimal or a hexadecimal scalar designating a code point in the\nplatform's native character set (extended to Unicode), or a string\ncontaining \"U+\" followed by hexadecimals designating a Unicode code\npoint. A leading 0 will force a hexadecimal interpretation, as will a\nhexadecimal digit that isn't a decimal digit.\n\nExamples:\n\n223     # Decimal 223 in native character set\n0223    # Hexadecimal 223, native (= 547 decimal)\n0xDF    # Hexadecimal DF, native (= 223 decimal)\n'0xDF'  # String form of hexadecimal (= 223 decimal)\n'U+DF'  # Hexadecimal DF, in Unicode's character set\n(= LATIN SMALL LETTER SHARP S)\n\nNote that the largest code point in Unicode is U+10FFFF.\n\ncharinfo()\nuse Unicode::UCD 'charinfo';\n\nmy $charinfo = charinfo(0x41);\n\nThis returns information about the input \"code point argument\" as a\nreference to a hash of fields as defined by the Unicode standard. If the\n\"code point argument\" is not assigned in the standard (i.e., has the\ngeneral category \"Cn\" meaning \"Unassigned\") or is a non-character\n(meaning it is guaranteed to never be assigned in the standard), \"undef\"\nis returned.\n\nFields that aren't applicable to the particular code point argument\nexist in the returned hash, and are empty.\n\nFor results that are less \"raw\" than this function returns, or to get\nthe values for any property, not just the few covered by this function,\nuse the \"charprop()\" function.\n\nThe keys in the hash with the meanings of their values are:\n\ncode\nthe input native \"code point argument\" expressed in hexadecimal,\nwith leading zeros added if necessary to make it contain at least\nfour hexdigits\n\nname\nname of *code*, all IN UPPER CASE. Some control-type code points do\nnot have names. This field will be empty for \"Surrogate\" and\n\"Private Use\" code points, and for the others without a name, it\nwill contain a description enclosed in angle brackets, like\n\"<control>\".\n\ncategory\nThe short name of the general category of *code*. This will match\none of the keys in the hash returned by \"generalcategories()\".\n\nThe \"propvaluealiases()\" function can be used to get all the\nsynonyms of the category name.\n\ncombining\nthe combining class number for *code* used in the Canonical Ordering\nAlgorithm. For Unicode 5.1, this is described in Section 3.11\n\"Canonical Ordering Behavior\" available at\n<http://www.unicode.org/versions/Unicode5.1.0/>\n\nThe \"propvaluealiases()\" function can be used to get all the\nsynonyms of the combining class number.\n\nbidi\nbidirectional type of *code*. This will match one of the keys in the\nhash returned by \"biditypes()\".\n\nThe \"propvaluealiases()\" function can be used to get all the\nsynonyms of the bidi type name.\n\ndecomposition\nis empty if *code* has no decomposition; or is one or more codes\n(separated by spaces) that, taken in order, represent a\ndecomposition for *code*. Each has at least four hexdigits. The\ncodes may be preceded by a word enclosed in angle brackets, then a\nspace, like \"<compat> \", giving the type of decomposition\n\nThis decomposition may be an intermediate one whose components are\nalso decomposable. Use Unicode::Normalize to get the final\ndecomposition in one step.\n\ndecimal\nif *code* represents a decimal digit this is its integer numeric\nvalue\n\ndigit\nif *code* represents some other digit-like number, this is its\ninteger numeric value\n\nnumeric\nif *code* represents a whole or rational number, this is its numeric\nvalue. Rational values are expressed as a string like \"1/4\".\n\nmirrored\n\"Y\" or \"N\" designating if *code* is mirrored in bidirectional text\n\nunicode10\nname of *code* in the Unicode 1.0 standard if one existed for this\ncode point and is different from the current name\n\ncomment\nAs of Unicode 6.0, this is always empty.\n\nupper\nis, if non-empty, the uppercase mapping for *code* expressed as at\nleast four hexdigits. This indicates that the full uppercase mapping\nis a single character, and is identical to the simple\n(single-character only) mapping. When this field is empty, it means\nthat the simple uppercase mapping is *code* itself; you'll need some\nother means, (like \"charprop()\" or \"casespec()\" to get the full\nmapping.\n\nlower\nis, if non-empty, the lowercase mapping for *code* expressed as at\nleast four hexdigits. This indicates that the full lowercase mapping\nis a single character, and is identical to the simple\n(single-character only) mapping. When this field is empty, it means\nthat the simple lowercase mapping is *code* itself; you'll need some\nother means, (like \"charprop()\" or \"casespec()\" to get the full\nmapping.\n\ntitle\nis, if non-empty, the titlecase mapping for *code* expressed as at\nleast four hexdigits. This indicates that the full titlecase mapping\nis a single character, and is identical to the simple\n(single-character only) mapping. When this field is empty, it means\nthat the simple titlecase mapping is *code* itself; you'll need some\nother means, (like \"charprop()\" or \"casespec()\" to get the full\nmapping.\n\nblock\nthe block *code* belongs to (used in \"\\p{Blk=...}\"). The\n\"propvaluealiases()\" function can be used to get all the synonyms\nof the block name.\n\nSee \"Blocks versus Scripts\".\n\nscript\nthe script *code* belongs to. The \"propvaluealiases()\" function\ncan be used to get all the synonyms of the script name. Note that\nthis is the older \"Script\" property value, and not the improved\n\"ScriptExtensions\" value.\n\nSee \"Blocks versus Scripts\".\n\nNote that you cannot do (de)composition and casing based solely on the\n*decomposition*, *combining*, *lower*, *upper*, and *title* fields; you\nwill need also the \"casespec()\" function and the \"CompositionExclusion\"\nproperty. (Or you could just use the lc(), uc(), and ucfirst()\nfunctions, and the Unicode::Normalize module.)\n\ncharprop()\nuse Unicode::UCD 'charprop';\n\nprint charprop(0x41, \"Gc\"), \"\\n\";\nprint charprop(0x61, \"GeneralCategory\"), \"\\n\";\n\nprints\nLu\nLl\n\nThis returns the value of the Unicode property given by the second\nparameter for the \"code point argument\" given by the first.\n\nThe passed-in property may be specified as any of the synonyms returned\nby \"propaliases()\".\n\nThe return value is always a scalar, either a string or a number. For\nproperties where there are synonyms for the values, the synonym returned\nby this function is the longest, most descriptive form, the one returned\nby \"propvaluealiases()\" when called in a scalar context. Of course,\nyou can call \"propvaluealiases()\" on the result to get other synonyms.\n\nThe return values are more \"cooked\" than the \"charinfo()\" ones. For\nexample, the \"uc\" property value is the actual string containing the\nfull uppercase mapping of the input code point. You have to go to extra\ntrouble with \"charinfo\" to get this value from its \"upper\" hash element\nwhen the full mapping differs from the simple one.\n\nSpecial note should be made of the return values for a few properties:\n\nBlock\nThe value returned is the new-style (see \"Old-style versus new-style\nblock names\").\n\nDecompositionMapping\nLike \"charinfo()\", the result may be an intermediate decomposition\nwhose components are also decomposable. Use Unicode::Normalize to\nget the final decomposition in one step.\n\nUnlike \"charinfo()\", this does not include the decomposition type.\nUse the \"DecompositionType\" property to get that.\n\nNameAlias\nIf the input code point's name has more than one synonym, they are\nreturned joined into a single comma-separated string.\n\nNumericValue\nIf the result is a fraction, it is converted into a floating point\nnumber to the accuracy of your platform.\n\nScriptExtensions\nIf the result is multiple script names, they are returned joined\ninto a single comma-separated string.\n\nWhen called with a property that is a Perl extension that isn't\nexpressible in a compound form, this function currently returns \"undef\",\nas the only two possible values are *true* or *false* (1 or 0 I\nsuppose). This behavior may change in the future, so don't write code\nthat relies on it. \"PresentIn\" is a Perl extension that is expressible\nin a bipartite or compound form (for example, \"\\p{PresentIn=4.0}\"), so\n\"charprop\" accepts it. But \"Any\" is a Perl extension that isn't\nexpressible that way, so \"charprop\" returns \"undef\" for it. Also\n\"charprop\" returns \"undef\" for all Perl extensions that are\ninternal-only.\n\ncharpropsall()\nuse Unicode::UCD 'charpropsall';\n\nmy $%propertiesofAhashref = charpropsall(\"U+41\");\n\nThis returns a reference to a hash whose keys are all the distinct\nUnicode (no Perl extension) properties, and whose values are the\nrespective values for those properties for the input \"code point\nargument\".\n\nEach key is the property name in its longest, most descriptive form. The\nvalues are what \"charprop()\" would return.\n\nThis function is expensive in time and memory.\n\ncharblock()\nuse Unicode::UCD 'charblock';\n\nmy $charblock = charblock(0x41);\nmy $charblock = charblock(1234);\nmy $charblock = charblock(0x263a);\nmy $charblock = charblock(\"U+263a\");\n\nmy $range     = charblock('Armenian');\n\nWith a \"code point argument\" \"charblock()\" returns the *block* the code\npoint belongs to, e.g. \"Basic Latin\". The old-style block name is\nreturned (see \"Old-style versus new-style block names\"). The\n\"propvaluealiases()\" function can be used to get all the synonyms of\nthe block name.\n\nIf the code point is unassigned, this returns the block it would belong\nto if it were assigned. (If the Unicode version being used is so early\nas to not have blocks, all code points are considered to be in\n\"NoBlock\".)\n\nSee also \"Blocks versus Scripts\".\n\nIf supplied with an argument that can't be a code point, \"charblock()\"\ntries to do the opposite and interpret the argument as an old-style\nblock name. On an ASCII platform, the return value is a *range set* with\none range: an anonymous array with a single element that consists of\nanother anonymous array whose first element is the first code point in\nthe block, and whose second element is the final code point in the\nblock. On an EBCDIC platform, the first two Unicode blocks are not\ncontiguous. Their range sets are lists containing *start-of-range*,\n*end-of-range* code point pairs. You can test whether a code point is in\na range set using the \"charinrange()\" function. (To be precise, each\n*range set* contains a third array element, after the range boundary\nones: the oldstyle block name.)\n\nIf the argument to \"charblock()\" is not a known block, \"undef\" is\nreturned.\n\ncharscript()\nuse Unicode::UCD 'charscript';\n\nmy $charscript = charscript(0x41);\nmy $charscript = charscript(1234);\nmy $charscript = charscript(\"U+263a\");\n\nmy $range      = charscript('Thai');\n\nWith a \"code point argument\", \"charscript()\" returns the *script* the\ncode point belongs to, e.g., \"Latin\", \"Greek\", \"Han\". If the code point\nis unassigned or the Unicode version being used is so early that it\ndoesn't have scripts, this function returns \"Unknown\". The\n\"propvaluealiases()\" function can be used to get all the synonyms of\nthe script name.\n\nNote that the ScriptExtensions property is an improved version of the\nScript property, and you should probably be using that instead, with the\n\"charprop()\" function.\n\nIf supplied with an argument that can't be a code point, charscript()\ntries to do the opposite and interpret the argument as a script name.\nThe return value is a *range set*: an anonymous array of arrays that\ncontain *start-of-range*, *end-of-range* code point pairs. You can test\nwhether a code point is in a range set using the \"charinrange()\"\nfunction. (To be precise, each *range set* contains a third array\nelement, after the range boundary ones: the script name.)\n\nIf the \"charscript()\" argument is not a known script, \"undef\" is\nreturned.\n\nSee also \"Blocks versus Scripts\".\n\ncharblocks()\nuse Unicode::UCD 'charblocks';\n\nmy $charblocks = charblocks();\n\n\"charblocks()\" returns a reference to a hash with the known block names\nas the keys, and the code point ranges (see \"charblock()\") as the\nvalues.\n\nThe names are in the old-style (see \"Old-style versus new-style block\nnames\").\n\npropinvmap(\"block\") can be used to get this same data in a different\ntype of data structure.\n\npropvalues(\"Block\") can be used to get all the known new-style block\nnames as a list, without the code point ranges.\n\nSee also \"Blocks versus Scripts\".\n\ncharscripts()\nuse Unicode::UCD 'charscripts';\n\nmy $charscripts = charscripts();\n\n\"charscripts()\" returns a reference to a hash with the known script\nnames as the keys, and the code point ranges (see \"charscript()\") as the\nvalues.\n\npropinvmap(\"script\") can be used to get this same data in a different\ntype of data structure. Since the ScriptExtensions property is an\nimproved version of the Script property, you should instead use\npropinvmap(\"scx\").\n\n\"propvalues(\"Script\")\" can be used to get all the known script names as\na list, without the code point ranges.\n\nSee also \"Blocks versus Scripts\".\n\ncharinrange()\nIn addition to using the \"\\p{Blk=...}\" and \"\\P{Blk=...}\" constructs, you\ncan also test whether a code point is in the *range* as returned by\n\"charblock()\" and \"charscript()\" or as the values of the hash returned\nby \"charblocks()\" and \"charscripts()\" by using \"charinrange()\":\n\nuse Unicode::UCD qw(charscript charinrange);\n\n$range = charscript('Hiragana');\nprint \"looks like hiragana\\n\" if charinrange($range, $codepoint);\n\ngeneralcategories()\nuse Unicode::UCD 'generalcategories';\n\nmy $categories = generalcategories();\n\nThis returns a reference to a hash which has short general category\nnames (such as \"Lu\", \"Nd\", \"Zs\", \"S\") as keys and long names (such as\n\"UppercaseLetter\", \"DecimalNumber\", \"SpaceSeparator\", \"Symbol\") as\nvalues. The hash is reversible in case you need to go from the long\nnames to the short names. The general category is the one returned from\n\"charinfo()\" under the \"category\" key.\n\nThe \"propvalues()\" and \"propvaluealiases()\" functions can be used as\nan alternative to this function; the first returning a simple list of\nthe short category names; and the second gets all the synonyms of a\ngiven category name.\n\nbiditypes()\nuse Unicode::UCD 'biditypes';\n\nmy $categories = biditypes();\n\nThis returns a reference to a hash which has the short bidi\n(bidirectional) type names (such as \"L\", \"R\") as keys and long names\n(such as \"Left-to-Right\", \"Right-to-Left\") as values. The hash is\nreversible in case you need to go from the long names to the short\nnames. The bidi type is the one returned from \"charinfo()\" under the\n\"bidi\" key. For the exact meaning of the various bidi classes the\nUnicode TR9 is recommended reading:\n<http://www.unicode.org/reports/tr9/> (as of Unicode 5.0.0)\n\nThe \"propvalues()\" and \"propvaluealiases()\" functions can be used as\nan alternative to this function; the first returning a simple list of\nthe short bidi type names; and the second gets all the synonyms of a\ngiven bidi type name.\n\ncompexcl()\nWARNING: Unicode discourages the use of this function or any of the\nalternative mechanisms listed in this section (the documentation of\n\"compexcl()\"), except internally in implementations of the Unicode\nNormalization Algorithm. You should be using Unicode::Normalize directly\ninstead of these. Using these will likely lead to half-baked results.\n\nuse Unicode::UCD 'compexcl';\n\nmy $compexcl = compexcl(0x09dc);\n\nThis routine returns \"undef\" if the Unicode version being used is so\nearly that it doesn't have this property.\n\n\"compexcl()\" is included for backwards compatibility, but as of Perl\n5.12 and more modern Unicode versions, for most purposes it is probably\nmore convenient to use one of the following instead:\n\nmy $compexcl = chr(0x09dc) =~ /\\p{CompEx};\nmy $compexcl = chr(0x09dc) =~ /\\p{FullCompositionExclusion};\n\nor even\n\nmy $compexcl = chr(0x09dc) =~ /\\p{CE};\nmy $compexcl = chr(0x09dc) =~ /\\p{CompositionExclusion};\n\nThe first two forms return true if the \"code point argument\" should not\nbe produced by composition normalization. For the final two forms to\nreturn true, it is additionally required that this fact not otherwise be\ndeterminable from the Unicode data base.\n\nThis routine behaves identically to the final two forms. That is, it\ndoes not return true if the code point has a decomposition consisting of\nanother single code point, nor if its decomposition starts with a code\npoint whose combining class is non-zero. Code points that meet either of\nthese conditions should also not be produced by composition\nnormalization, which is probably why you should use the\n\"FullCompositionExclusion\" property instead, as shown above.\n\nThe routine returns false otherwise.\n\ncasefold()\nuse Unicode::UCD 'casefold';\n\nmy $casefold = casefold(0xDF);\nif (defined $casefold) {\nmy @fullfoldhex = split / /, $casefold->{'full'};\nmy $fullfoldstring =\njoin \"\", map {chr(hex($))} @fullfoldhex;\nmy @turkicfoldhex =\nsplit / /, ($casefold->{'turkic'} ne \"\")\n? $casefold->{'turkic'}\n: $casefold->{'full'};\nmy $turkicfoldstring =\njoin \"\", map {chr(hex($))} @turkicfoldhex;\n}\nif (defined $casefold && $casefold->{'simple'} ne \"\") {\nmy $simplefoldhex = $casefold->{'simple'};\nmy $simplefoldstring = chr(hex($simplefoldhex));\n}\n\nThis returns the (almost) locale-independent case folding of the\ncharacter specified by the \"code point argument\". (Starting in Perl\nv5.16, the core function \"fc()\" returns the \"full\" mapping (described\nbelow) faster than this does, and for entire strings.)\n\nIf there is no case folding for the input code point, \"undef\" is\nreturned.\n\nIf there is a case folding for that code point, a reference to a hash\nwith the following fields is returned:\n\ncode\nthe input native \"code point argument\" expressed in hexadecimal,\nwith leading zeros added if necessary to make it contain at least\nfour hexdigits\n\nfull\none or more codes (separated by spaces) that, taken in order, give\nthe code points for the case folding for *code*. Each has at least\nfour hexdigits.\n\nsimple\nis empty, or is exactly one code with at least four hexdigits which\ncan be used as an alternative case folding when the calling program\ncannot cope with the fold being a sequence of multiple code points.\nIf *full* is just one code point, then *simple* equals *full*. If\nthere is no single code point folding defined for *code*, then\n*simple* is the empty string. Otherwise, it is an inferior, but\nstill better-than-nothing alternative folding to *full*.\n\nmapping\nis the same as *simple* if *simple* is not empty, and it is the same\nas *full* otherwise. It can be considered to be the simplest\npossible folding for *code*. It is defined primarily for backwards\ncompatibility.\n\nstatus\nis \"C\" (for \"common\") if the best possible fold is a single code\npoint (*simple* equals *full* equals *mapping*). It is \"S\" if there\nare distinct folds, *simple* and *full* (*mapping* equals *simple*).\nAnd it is \"F\" if there is only a *full* fold (*mapping* equals\n*full*; *simple* is empty). Note that this describes the contents of\n*mapping*. It is defined primarily for backwards compatibility.\n\nFor Unicode versions between 3.1 and 3.1.1 inclusive, *status* can\nalso be \"I\" which is the same as \"C\" but is a special case for\ndotted uppercase I and dotless lowercase i:\n\n* If you use this \"I\" mapping\nthe result is case-insensitive, but dotless and dotted I's are\nnot distinguished\n\n* If you exclude this \"I\" mapping\nthe result is not fully case-insensitive, but dotless and dotted\nI's are distinguished\n\nturkic\ncontains any special folding for Turkic languages. For versions of\nUnicode starting with 3.2, this field is empty unless *code* has a\ndifferent folding in Turkic languages, in which case it is one or\nmore codes (separated by spaces) that, taken in order, give the code\npoints for the case folding for *code* in those languages. Each code\nhas at least four hexdigits. Note that this folding does not\nmaintain canonical equivalence without additional processing.\n\nFor Unicode versions between 3.1 and 3.1.1 inclusive, this field is\nempty unless there is a special folding for Turkic languages, in\nwhich case *status* is \"I\", and *mapping*, *full*, *simple*, and\n*turkic* are all equal.\n\nPrograms that want complete generality and the best folding results\nshould use the folding contained in the *full* field. But note that the\nfold for some code points will be a sequence of multiple code points.\n\nPrograms that can't cope with the fold mapping being multiple code\npoints can use the folding contained in the *simple* field, with the\nloss of some generality. In Unicode 5.1, about 7% of the defined\nfoldings have no single code point folding.\n\nThe *mapping* and *status* fields are provided for backwards\ncompatibility for existing programs. They contain the same values as in\nprevious versions of this function.\n\nLocale is not completely independent. The *turkic* field contains\nresults to use when the locale is a Turkic language.\n\nFor more information about case mappings see\n<http://www.unicode.org/unicode/reports/tr21>\n\nallcasefolds()\nuse Unicode::UCD 'allcasefolds';\n\nmy $allfoldsref = allcasefolds();\nforeach my $charwithcasefold (sort { $a <=> $b }\nkeys %$allfoldsref)\n{\nprintf \"%04X:\", $charwithcasefold;\nmy $casefold = $allfoldsref->{$charwithcasefold};\n\n# Get folds for $charwithcasefold\n\nmy @fullfoldhex = split / /, $casefold->{'full'};\nmy $fullfoldstring =\njoin \"\", map {chr(hex($))} @fullfoldhex;\nprint \" full=\", join \" \", @fullfoldhex;\nmy @turkicfoldhex =\nsplit / /, ($casefold->{'turkic'} ne \"\")\n? $casefold->{'turkic'}\n: $casefold->{'full'};\nmy $turkicfoldstring =\njoin \"\", map {chr(hex($))} @turkicfoldhex;\nprint \"; turkic=\", join \" \", @turkicfoldhex;\nif (defined $casefold && $casefold->{'simple'} ne \"\") {\nmy $simplefoldhex = $casefold->{'simple'};\nmy $simplefoldstring = chr(hex($simplefoldhex));\nprint \"; simple=$simplefoldhex\";\n}\nprint \"\\n\";\n}\n\nThis returns all the case foldings in the current version of Unicode in\nthe form of a reference to a hash. Each key to the hash is the decimal\nrepresentation of a Unicode character that has a casefold to other than\nitself. The casefold of a semi-colon is itself, so it isn't in the hash;\nlikewise for a lowercase \"a\", but there is an entry for a capital \"A\".\nThe hash value for each key is another hash, identical to what is\nreturned by \"casefold()\" if called with that code point as its argument.\nSo the value \"allcasefolds()->{ord(\"A\")}'\" is equivalent to\n\"casefold(ord(\"A\"))\";\n\ncasespec()\nuse Unicode::UCD 'casespec';\n\nmy $casespec = casespec(0xFB00);\n\nThis returns the potentially locale-dependent case mappings of the \"code\npoint argument\". The mappings may be longer than a single code point\n(which the basic Unicode case mappings as returned by \"charinfo()\" never\nare).\n\nIf there are no case mappings for the \"code point argument\", or if all\nthree possible mappings (*lower*, *title* and *upper*) result in single\ncode points and are locale independent and unconditional, \"undef\" is\nreturned (which means that the case mappings, if any, for the code point\nare those returned by \"charinfo()\").\n\nOtherwise, a reference to a hash giving the mappings (or a reference to\na hash of such hashes, explained below) is returned with the following\nkeys and their meanings:\n\nThe keys in the bottom layer hash with the meanings of their values are:\n\ncode\nthe input native \"code point argument\" expressed in hexadecimal,\nwith leading zeros added if necessary to make it contain at least\nfour hexdigits\n\nlower\none or more codes (separated by spaces) that, taken in order, give\nthe code points for the lower case of *code*. Each has at least four\nhexdigits.\n\ntitle\none or more codes (separated by spaces) that, taken in order, give\nthe code points for the title case of *code*. Each has at least four\nhexdigits.\n\nupper\none or more codes (separated by spaces) that, taken in order, give\nthe code points for the upper case of *code*. Each has at least four\nhexdigits.\n\ncondition\nthe conditions for the mappings to be valid. If \"undef\", the\nmappings are always valid. When defined, this field is a list of\nconditions, all of which must be true for the mappings to be valid.\nThe list consists of one or more *locales* (see below) and/or\n*contexts* (explained in the next paragraph), separated by spaces.\n(Other than as used to separate elements, spaces are to be ignored.)\nCase distinctions in the condition list are not significant.\nConditions preceded by \"NON\" represent the negation of the\ncondition.\n\nA *context* is one of those defined in the Unicode standard. For\nUnicode 5.1, they are defined in Section 3.13 \"Default Case\nOperations\" available at\n<http://www.unicode.org/versions/Unicode5.1.0/>. These are for\ncontext-sensitive casing.\n\nThe hash described above is returned for locale-independent casing,\nwhere at least one of the mappings has length longer than one. If\n\"undef\" is returned, the code point may have mappings, but if so, all\nare length one, and are returned by \"charinfo()\". Note that when this\nfunction does return a value, it will be for the complete set of\nmappings for a code point, even those whose length is one.\n\nIf there are additional casing rules that apply only in certain locales,\nan additional key for each will be defined in the returned hash. Each\nsuch key will be its locale name, defined as a 2-letter ISO 3166 country\ncode, possibly followed by a \"\" and a 2-letter ISO language code\n(possibly followed by a \"\" and a variant code). You can find the lists\nof all possible locales, see Locale::Country and Locale::Language. (In\nUnicode 6.0, the only locales returned by this function are \"lt\", \"tr\",\nand \"az\".)\n\nEach locale key is a reference to a hash that has the form above, and\ngives the casing rules for that particular locale, which take precedence\nover the locale-independent ones when in that locale.\n\nIf the only casing for a code point is locale-dependent, then the\nreturned hash will not have any of the base keys, like \"code\", \"upper\",\netc., but will contain only locale keys.\n\nFor more information about case mappings see\n<http://www.unicode.org/unicode/reports/tr21/>\n\nnamedseq()\nuse Unicode::UCD 'namedseq';\n\nmy $namedseq = namedseq(\"KATAKANA LETTER AINU P\");\nmy @namedseq = namedseq(\"KATAKANA LETTER AINU P\");\nmy %namedseq = namedseq();\n\nIf used with a single argument in a scalar context, returns the string\nconsisting of the code points of the named sequence, or \"undef\" if no\nnamed sequence by that name exists. If used with a single argument in a\nlist context, it returns the list of the ordinals of the code points.\n\nIf used with no arguments in a list context, it returns a hash with the\nnames of all the named sequences as the keys and their sequences as\nstrings as the values. Otherwise, it returns \"undef\" or an empty list\ndepending on the context.\n\nThis function only operates on officially approved (not provisional)\nnamed sequences.\n\nNote that as of Perl 5.14, \"\\N{KATAKANA LETTER AINU P}\" will insert the\nnamed sequence into double-quoted strings, and\n\"charnames::stringvianame(\"KATAKANA LETTER AINU P\")\" will return the\nsame string this function does, but will also operate on character names\nthat aren't named sequences, without you having to know which are which.\nSee charnames.\n\nnum()\nuse Unicode::UCD 'num';\n\nmy $val = num(\"123\");\nmy $onequarter = num(\"\\N{VULGAR FRACTION 1/4}\");\nmy $val = num(\"12a\", \\$validlength);  # $validlength contains 2\n\n\"num()\" returns the numeric value of the input Unicode string; or\n\"undef\" if it doesn't think the entire string has a completely valid,\nsafe numeric value. If called with an optional second parameter, a\nreference to a scalar, \"num()\" will set the scalar to the length of any\nvalid initial substring; or to 0 if none.\n\nIf the string is just one character in length, the Unicode numeric value\nis returned if it has one, or \"undef\" otherwise. If the optional scalar\nref is passed, it would be set to 1 if the return is valid; or 0 if the\nreturn is \"undef\". Note that the numeric value returned need not be a\nwhole number. \"num(\"\\N{TIBETAN DIGIT HALF ZERO}\")\", for example returns\n-0.5.\n\nIf the string is more than one character, \"undef\" is returned unless all\nits characters are decimal digits (that is, they would match \"\\d+\"),\nfrom the same script. For example if you have an ASCII '0' and a Bengali\n'3', mixed together, they aren't considered a valid number, and \"undef\"\nis returned. A further restriction is that the digits all have to be of\nthe same form. A half-width digit mixed with a full-width one will\nreturn \"undef\". The Arabic script has two sets of digits; \"num\" will\nreturn \"undef\" unless all the digits in the string come from the same\nset. In all cases, the optional scalar ref parameter is set to how long\nany valid initial substring of digits is; hence it will be set to the\nentire string length if the main return value is not \"undef\".\n\n\"num\" errs on the side of safety, and there may be valid strings of\ndecimal digits that it doesn't recognize. Note that Unicode defines a\nnumber of \"digit\" characters that aren't \"decimal digit\" characters.\n\"Decimal digits\" have the property that they have a positional value,\ni.e., there is a units position, a 10's position, a 100's, etc, AND they\nare arranged in Unicode in blocks of 10 contiguous code points. The\nChinese digits, for example, are not in such a contiguous block, and so\nUnicode doesn't view them as decimal digits, but merely digits, and so\n\"\\d\" will not match them. A single-character string containing one of\nthese digits will have its decimal value returned by \"num\", but any\nlonger string containing only these digits will return \"undef\".\n\nStrings of multiple sub- and superscripts are not recognized as numbers.\nYou can use either of the compatibility decompositions in\nUnicode::Normalize to change these into digits, and then call \"num\" on\nthe result.\n\npropaliases()\nuse Unicode::UCD 'propaliases';\n\nmy ($shortname, $fullname, @othernames) = propaliases(\"space\");\nmy $samefullname = propaliases(\"Space\");     # Scalar context\nmy ($sameshortname) = propaliases(\"Space\");  # gets 0th element\nprint \"The full name is $fullname\\n\";\nprint \"The short name is $shortname\\n\";\nprint \"The other aliases are: \", join(\", \", @othernames), \"\\n\";\n\nprints:\nThe full name is WhiteSpace\nThe short name is WSpace\nThe other aliases are: Space\n\nMost Unicode properties have several synonymous names. Typically, there\nis at least a short name, convenient to type, and a long name that more\nfully describes the property, and hence is more easily understood.\n\nIf you know one name for a Unicode property, you can use \"propaliases\"\nto find either the long name (when called in scalar context), or a list\nof all of the names, somewhat ordered so that the short name is in the\n0th element, the long name in the next element, and any other synonyms\nare in the remaining elements, in no particular order.\n\nThe long name is returned in a form nicely capitalized, suitable for\nprinting.\n\nThe input parameter name is loosely matched, which means that white\nspace, hyphens, and underscores are ignored (except for the trailing\nunderscore in the oldform grandfathered-in \"L\", which is better\nwritten as \"LC\", and both of which mean \"GeneralCategory=Cased\nLetter\").\n\nIf the name is unknown, \"undef\" is returned (or an empty list in list\ncontext). Note that Perl typically recognizes property names in regular\nexpressions with an optional \"\"Is\"\" (with or without the underscore)\nprefixed to them, such as \"\\p{isgc=punct}\". This function does not\nrecognize those in the input, returning \"undef\". Nor are they included\nin the output as possible synonyms.\n\n\"propaliases\" does know about the Perl extensions to Unicode\nproperties, such as \"Any\" and \"XPosixAlpha\", and the single form\nequivalents to Unicode properties such as \"XDigit\", \"Greek\", \"InGreek\",\nand \"IsGreek\". The final example demonstrates that the \"Is\" prefix is\nrecognized for these extensions; it is needed to resolve ambiguities.\nFor example, \"propaliases('lc')\" returns the list \"(lc,\nLowercaseMapping)\", but \"propaliases('islc')\" returns \"(IsLC,\nCasedLetter)\". This is because \"islc\" is a Perl extension which is\nshort for \"GeneralCategory=Cased Letter\". The lists returned for the\nPerl extensions will not include the \"Is\" prefix (whether or not the\ninput had it) unless needed to resolve ambiguities, as shown in the\n\"islc\" example, where the returned list had one element containing\n\"Is\", and the other without.\n\nIt is also possible for the reverse to happen: \"propaliases('isc')\"\nreturns the list \"(isc, ISOComment)\"; whereas \"propaliases('c')\"\nreturns \"(C, Other)\" (the latter being a Perl extension meaning\n\"GeneralCategory=Other\". \"Properties accessible through Unicode::UCD\"\nin perluniprops lists the available forms, including which ones are\ndiscouraged from use.\n\nThose discouraged forms are accepted as input to \"propaliases\", but are\nnot returned in the lists. \"propaliases('isL&')\" and\n\"propaliases('isL')\", which are old synonyms for \"IsLC\" and should\nnot be used in new code, are examples of this. These both return\n\"(IsLC, CasedLetter)\". Thus this function allows you to take a\ndiscouraged form, and find its acceptable alternatives. The same goes\nwith single-form Block property equivalences. Only the forms that begin\nwith \"In\" are not discouraged; if you pass \"propaliases\" a discouraged\nform, you will get back the equivalent ones that begin with \"In\". It\nwill otherwise look like a new-style block name (see. \"Old-style versus\nnew-style block names\").\n\n\"propaliases\" does not know about any user-defined properties, and will\nreturn \"undef\" if called with one of those. Likewise for Perl internal\nproperties, with the exception of \"PerlDecimalDigit\" which it does\nknow about (and which is documented below in \"propinvmap()\").\n\npropvalues()\nuse Unicode::UCD 'propvalues';\n\nprint \"AHex values are: \", join(\", \", propvalues(\"AHex\")),\n\"\\n\";\nprints:\nAHex values are: N, Y\n\nSome Unicode properties have a restricted set of legal values. For\nexample, all binary properties are restricted to just \"true\" or \"false\";\nand there are only a few dozen possible General Categories. Use\n\"propvalues\" to find out if a given property is one such, and if so, to\nget a list of the values:\n\nprint join \", \", propvalues(\"NFCQuickCheck\");\nprints:\nM, N, Y\n\nIf the property doesn't have such a restricted set, \"undef\" is returned.\n\nThere are usually several synonyms for each possible value. Use\n\"propvaluealiases()\" to access those.\n\nCase, white space, hyphens, and underscores are ignored in the input\nproperty name (except for the trailing underscore in the old-form\ngrandfathered-in general category property value \"L\", which is better\nwritten as \"LC\").\n\nIf the property name is unknown, \"undef\" is returned. Note that Perl\ntypically recognizes property names in regular expressions with an\noptional \"\"Is\"\" (with or without the underscore) prefixed to them, such\nas \"\\p{isgc=punct}\". This function does not recognize those in the\nproperty parameter, returning \"undef\".\n\nFor the block property, new-style block names are returned (see\n\"Old-style versus new-style block names\").\n\n\"propvalues\" does not know about any user-defined properties, and will\nreturn \"undef\" if called with one of those.\n\npropvaluealiases()\nuse Unicode::UCD 'propvaluealiases';\n\nmy ($shortname, $fullname, @othernames)\n= propvaluealiases(\"Gc\", \"Punct\");\nmy $samefullname = propvaluealiases(\"Gc\", \"P\");   # Scalar cntxt\nmy ($sameshortname) = propvaluealiases(\"Gc\", \"P\"); # gets 0th\n# element\nprint \"The full name is $fullname\\n\";\nprint \"The short name is $shortname\\n\";\nprint \"The other aliases are: \", join(\", \", @othernames), \"\\n\";\n\nprints:\nThe full name is Punctuation\nThe short name is P\nThe other aliases are: Punct\n\nSome Unicode properties have a restricted set of legal values. For\nexample, all binary properties are restricted to just \"true\" or \"false\";\nand there are only a few dozen possible General Categories.\n\nYou can use \"propvalues()\" to find out if a given property is one which\nhas a restricted set of values, and if so, what those values are. But\nusually each value actually has several synonyms. For example, in\nUnicode binary properties, *truth* can be represented by any of the\nstrings \"Y\", \"Yes\", \"T\", or \"True\"; and the General Category\n\"Punctuation\" by that string, or \"Punct\", or simply \"P\".\n\nLike property names, there is typically at least a short name for each\nsuch property-value, and a long name. If you know any name of the\nproperty-value (which you can get by \"propvalues()\", you can use\n\"propvaluealiases\"() to get the long name (when called in scalar\ncontext), or a list of all the names, with the short name in the 0th\nelement, the long name in the next element, and any other synonyms in\nthe remaining elements, in no particular order, except that any\nall-numeric synonyms will be last.\n\nThe long name is returned in a form nicely capitalized, suitable for\nprinting.\n\nCase, white space, hyphens, and underscores are ignored in the input\nparameters (except for the trailing underscore in the old-form\ngrandfathered-in general category property value \"L\", which is better\nwritten as \"LC\").\n\nIf either name is unknown, \"undef\" is returned. Note that Perl typically\nrecognizes property names in regular expressions with an optional\n\"\"Is\"\" (with or without the underscore) prefixed to them, such as\n\"\\p{isgc=punct}\". This function does not recognize those in the property\nparameter, returning \"undef\".\n\nIf called with a property that doesn't have synonyms for its values, it\nreturns the input value, possibly normalized with capitalization and\nunderscores, but not necessarily checking that the input value is valid.\n\nFor the block property, new-style block names are returned (see\n\"Old-style versus new-style block names\").\n\nTo find the synonyms for single-forms, such as \"\\p{Any}\", use\n\"propaliases()\" instead.\n\n\"propvaluealiases\" does not know about any user-defined properties,\nand will return \"undef\" if called with one of those.\n\npropinvlist()\n\"propinvlist\" returns an inversion list (described below) that defines\nall the code points for the binary Unicode property (or \"property=value\"\npair) given by the input parameter string:\n\nuse feature 'say';\nuse Unicode::UCD 'propinvlist';\nsay join \", \", propinvlist(\"Any\");\n\nprints:\n0, 1114112\n\nIf the input is unknown \"undef\" is returned in scalar context; an\nempty-list in list context. If the input is known, the number of\nelements in the list is returned if called in scalar context.\n\nperluniprops gives the list of properties that this function accepts, as\nwell as all the possible forms for them (including with the optional\n\"Is\" prefixes). (Except this function doesn't accept any Perl-internal\nproperties, some of which are listed there.) This function uses the same\nloose or tighter matching rules for resolving the input property's name\nas is done for regular expressions. These are also specified in\nperluniprops. Examples of using the \"property=value\" form are:\n\nsay join \", \", propinvlist(\"ScriptExtensions=Shavian\");\n\nprints:\n66640, 66688\n\nsay join \", \", propinvlist(\"ASCIIHexDigit=No\");\n\nprints:\n0, 48, 58, 65, 71, 97, 103\n\nsay join \", \", propinvlist(\"ASCIIHexDigit=Yes\");\n\nprints:\n48, 58, 65, 71, 97, 103\n\nInversion lists are a compact way of specifying Unicode property-value\ndefinitions. The 0th item in the list is the lowest code point that has\nthe property-value. The next item (item [1]) is the lowest code point\nbeyond that one that does NOT have the property-value. And the next item\nbeyond that ([2]) is the lowest code point beyond that one that does\nhave the property-value, and so on. Put another way, each element in the\nlist gives the beginning of a range that has the property-value (for\neven numbered elements), or doesn't have the property-value (for odd\nnumbered elements). The name for this data structure stems from the fact\nthat each element in the list toggles (or inverts) whether the\ncorresponding range is or isn't on the list.\n\nIn the final example above, the first ASCII Hex digit is code point 48,\nthe character \"0\", and all code points from it through 57 (a \"9\") are\nASCII hex digits. Code points 58 through 64 aren't, but 65 (an \"A\")\nthrough 70 (an \"F\") are, as are 97 (\"a\") through 102 (\"f\"). 103 starts a\nrange of code points that aren't ASCII hex digits. That range extends to\ninfinity, which on your computer can be found in the variable\n$Unicode::UCD::MAXCP. (This variable is as close to infinity as Perl\ncan get on your platform, and may be too high for some operations to\nwork; you may wish to use a smaller number for your purposes.)\n\nNote that the inversion lists returned by this function can possibly\ninclude non-Unicode code points, that is anything above 0x10FFFF.\nUnicode properties are not defined on such code points. You might wish\nto change the output to not include these. Simply add 0x110000 at the\nend of the non-empty returned list if it isn't already that value; and\npop that value if it is; like:\n\nmy @list = propinvlist(\"foo\");\nif (@list) {\nif ($list[-1] == 0x110000) {\npop @list;  # Defeat the turning on for above Unicode\n}\nelse {\npush @list, 0x110000; # Turn off for above Unicode\n}\n}\n\nIt is a simple matter to expand out an inversion list to a full list of\nall code points that have the property-value:\n\nmy @invlist = propinvlist($propertyname);\ndie \"empty\" unless @invlist;\nmy @fulllist;\nfor (my $i = 0; $i < @invlist; $i += 2) {\nmy $upper = ($i + 1) < @invlist\n? $invlist[$i+1] - 1      # In range\n: $Unicode::UCD::MAXCP;  # To infinity.\nfor my $j ($invlist[$i] .. $upper) {\npush @fulllist, $j;\n}\n}\n\n\"propinvlist\" does not know about any user-defined nor Perl\ninternal-only properties, and will return \"undef\" if called with one of\nthose.\n\nThe \"searchinvlist()\" function is provided for finding a code point\nwithin an inversion list.\n\npropinvmap()\nuse Unicode::UCD 'propinvmap';\nmy ($listref, $mapref, $format, $default)\n= propinvmap(\"General Category\");\n\n\"propinvmap\" is used to get the complete mapping definition for a\nproperty, in the form of an inversion map. An inversion map consists of\ntwo parallel arrays. One is an ordered list of code points that mark\nrange beginnings, and the other gives the value (or mapping) that all\ncode points in the corresponding range have.\n\n\"propinvmap\" is called with the name of the desired property. The name\nis loosely matched, meaning that differences in case, white-space,\nhyphens, and underscores are not meaningful (except for the trailing\nunderscore in the old-form grandfathered-in property \"L\", which is\nbetter written as \"LC\", or even better, \"Gc=LC\").\n\nMany Unicode properties have more than one name (or alias).\n\"propinvmap\" understands all of these, including Perl extensions to\nthem. Ambiguities are resolved as described above for \"propaliases()\"\n(except if a property has both a complete mapping, and a binary \"Y\"/\"N\"\nmapping, then specifying the property name prefixed by \"is\" causes the\nbinary one to be returned). The Perl internal property\n\"PerlDecimalDigit, described below, is also accepted. An empty list is\nreturned if the property name is unknown. See \"Properties accessible\nthrough Unicode::UCD\" in perluniprops for the properties acceptable as\ninputs to this function.\n\nIt is a fatal error to call this function except in list context.\n\nIn addition to the two arrays that form the inversion map, \"propinvmap\"\nreturns two other values; one is a scalar that gives some details as to\nthe format of the entries of the map array; the other is a default\nvalue, useful in maps whose format name begins with the letter \"a\", as\ndescribed below in its subsection; and for specialized purposes, such as\nconverting to another data structure, described at the end of this main\nsection.\n\nThis means that \"propinvmap\" returns a 4 element list. For example,\n\nmy ($blocksrangesref, $blocksmapsref, $format, $default)\n= propinvmap(\"Block\");\n\nIn this call, the two arrays will be populated as shown below (for\nUnicode 6.0):\n\nIndex  @blocksranges  @blocksmaps\n0        0x0000      Basic Latin\n1        0x0080      Latin-1 Supplement\n2        0x0100      Latin Extended-A\n3        0x0180      Latin Extended-B\n4        0x0250      IPA Extensions\n5        0x02B0      Spacing Modifier Letters\n6        0x0300      Combining Diacritical Marks\n7        0x0370      Greek and Coptic\n8        0x0400      Cyrillic\n...\n233        0x2B820     NoBlock\n234        0x2F800     CJK Compatibility Ideographs Supplement\n235        0x2FA20     NoBlock\n236        0xE0000     Tags\n237        0xE0080     NoBlock\n238        0xE0100     Variation Selectors Supplement\n239        0xE01F0     NoBlock\n240        0xF0000     Supplementary Private Use Area-A\n241        0x100000    Supplementary Private Use Area-B\n242        0x110000    NoBlock\n\nThe first line (with Index [0]) means that the value for code point 0 is\n\"Basic Latin\". The entry \"0x0080\" in the @blocksranges column in the\nsecond line means that the value from the first line, \"Basic Latin\",\nextends to all code points in the range from 0 up to but not including\n0x0080, that is, through 127. In other words, the code points from 0 to\n127 are all in the \"Basic Latin\" block. Similarly, all code points in\nthe range from 0x0080 up to (but not including) 0x0100 are in the block\nnamed \"Latin-1 Supplement\", etc. (Notice that the return is the\nold-style block names; see \"Old-style versus new-style block names\").\n\nThe final line (with Index [242]) means that the value for all code\npoints above the legal Unicode maximum code point have the value\n\"NoBlock\", which is the term Unicode uses for a non-existing block.\n\nThe arrays completely specify the mappings for all possible code points.\nThe final element in an inversion map returned by this function will\nalways be for the range that consists of all the code points that aren't\nlegal Unicode, but that are expressible on the platform. (That is, it\nstarts with code point 0x110000, the first code point above the legal\nUnicode maximum, and extends to infinity.) The value for that range will\nbe the same that any typical unassigned code point has for the specified\nproperty. (Certain unassigned code points are not \"typical\"; for example\nthe non-character code points, or those in blocks that are to be written\nright-to-left. The above-Unicode range's value is not based on these\natypical code points.) It could be argued that, instead of treating\nthese as unassigned Unicode code points, the value for this range should\nbe \"undef\". If you wish, you can change the returned arrays accordingly.\n\nThe maps for almost all properties are simple scalars that should be\ninterpreted as-is. These values are those given in the Unicode-supplied\ndata files, which may be inconsistent as to capitalization and as to\nwhich synonym for a property-value is given. The results may be\nnormalized by using the \"propvaluealiases()\" function.\n\nThere are exceptions to the simple scalar maps. Some properties have\nsome elements in their map list that are themselves lists of scalars;\nand some special strings are returned that are not to be interpreted\nas-is. Element [2] (placed into $format in the example above) of the\nreturned four element list tells you if the map has any of these special\nelements or not, as follows:\n\n\"s\" means all the elements of the map array are simple scalars, with no\nspecial elements. Almost all properties are like this, like the\n\"block\" example above.\n\n\"sl\"\nmeans that some of the map array elements have the form given by\n\"s\", and the rest are lists of scalars. For example, here is a\nportion of the output of calling \"propinvmap\"() with the \"Script\nExtensions\" property:\n\n@scriptsranges  @scriptsmaps\n...\n0x0953      Devanagari\n0x0964      [ Bengali, Devanagari, Gurumukhi, Oriya ]\n0x0966      Devanagari\n0x0970      Common\n\nHere, the code points 0x964 and 0x965 are both used in Bengali,\nDevanagari, Gurmukhi, and Oriya, but no other scripts.\n\nThe NameAlias property is also of this form. But each scalar\nconsists of two components: 1) the name, and 2) the type of alias\nthis is. They are separated by a colon and a space. In Unicode 6.1,\nthere are several alias types:\n\n\"correction\"\nindicates that the name is a corrected form for the original\nname (which remains valid) for the same code point.\n\n\"control\"\nadds a new name for a control character.\n\n\"alternate\"\nis an alternate name for a character\n\n\"figment\"\nis a name for a character that has been documented but was never\nin any actual standard.\n\n\"abbreviation\"\nis a common abbreviation for a character\n\nThe lists are ordered (roughly) so the most preferred names come\nbefore less preferred ones.\n\nFor example,\n\n@aliasesranges        @aliasmaps\n...\n0x009E        [ 'PRIVACY MESSAGE: control', 'PM: abbreviation' ]\n0x009F        [ 'APPLICATION PROGRAM COMMAND: control',\n'APC: abbreviation'\n]\n0x00A0        'NBSP: abbreviation'\n0x00A1        \"\"\n0x00AD        'SHY: abbreviation'\n0x00AE        \"\"\n0x01A2        'LATIN CAPITAL LETTER GHA: correction'\n0x01A3        'LATIN SMALL LETTER GHA: correction'\n0x01A4        \"\"\n...\n\nA map to the empty string means that there is no alias defined for\nthe code point.\n\n\"a\" is like \"s\" in that all the map array elements are scalars, but here\nthey are restricted to all being integers, and some have to be\nadjusted (hence the name \"a\") to get the correct result. For\nexample, in:\n\nmy ($uppersrangesref, $uppersmapsref, $format, $default)\n= propinvmap(\"SimpleUppercaseMapping\");\n\nthe returned arrays look like this:\n\n@$uppersrangesref    @$uppersmapsref   Note\n0                      0\n97                     65          'a' maps to 'A', b => B ...\n123                      0\n181                    924          MICRO SIGN => Greek Cap MU\n182                      0\n...\n\nand $default is 0.\n\nLet's start with the second line. It says that the uppercase of code\npoint 97 is 65; or \"uc(\"a\")\" == \"A\". But the line is for the entire\nrange of code points 97 through 122. To get the mapping for any code\npoint in this range, you take the offset it has from the beginning\ncode point of the range, and add that to the mapping for that first\ncode point. So, the mapping for 122 (\"z\") is derived by taking the\noffset of 122 from 97 (=25) and adding that to 65, yielding 90\n(\"z\"). Likewise for everything in between.\n\nRequiring this simple adjustment allows the returned arrays to be\nsignificantly smaller than otherwise, up to a factor of 10, speeding\nup searching through them.\n\nRanges that map to $default, \"0\", behave somewhat differently. For\nthese, each code point maps to itself. So, in the first line in the\nexample, \"ord(uc(chr(0)))\" is 0, \"ord(uc(chr(1)))\" is 1, ..\n\"ord(uc(chr(96)))\" is 96.\n\n\"al\"\nmeans that some of the map array elements have the form given by\n\"a\", and the rest are ordered lists of code points. For example, in:\n\nmy ($uppersrangesref, $uppersmapsref, $format, $default)\n= propinvmap(\"UppercaseMapping\");\n\nthe returned arrays look like this:\n\n@$uppersrangesref    @$uppersmapsref\n0                      0\n97                     65\n123                      0\n181                    924\n182                      0\n...\n0x0149              [ 0x02BC 0x004E ]\n0x014A                    0\n0x014B                  330\n...\n\nThis is the full UppercaseMapping property (as opposed to the\nSimpleUppercaseMapping given in the example for format \"a\"). The\nonly difference between the two in the ranges shown is that the code\npoint at 0x0149 (LATIN SMALL LETTER N PRECEDED BY APOSTROPHE) maps\nto a string of two characters, 0x02BC (MODIFIER LETTER APOSTROPHE)\nfollowed by 0x004E (LATIN CAPITAL LETTER N).\n\nNo adjustments are needed to entries that are references to arrays;\neach such entry will have exactly one element in its range, so the\noffset is always 0.\n\nThe fourth (index [3]) element ($default) in the list returned for\nthis format is 0.\n\n\"ae\"\nThis is like \"a\", but some elements are the empty string, and should\nnot be adjusted. The one internal Perl property accessible by\n\"propinvmap\" is of this type: \"PerlDecimalDigit\" returns an\ninversion map which gives the numeric values that are represented by\nthe Unicode decimal digit characters. Characters that don't\nrepresent decimal digits map to the empty string, like so:\n\n@digits    @values\n0x0000       \"\"\n0x0030        0\n0x003A:      \"\"\n0x0660:       0\n0x066A:      \"\"\n0x06F0:       0\n0x06FA:      \"\"\n0x07C0:       0\n0x07CA:      \"\"\n0x0966:       0\n...\n\nThis means that the code points from 0 to 0x2F do not represent\ndecimal digits; the code point 0x30 (DIGIT ZERO) represents 0; code\npoint 0x31, (DIGIT ONE), represents 0+1-0 = 1; ... code point 0x39,\n(DIGIT NINE), represents 0+9-0 = 9; ... code points 0x3A through\n0x65F do not represent decimal digits; 0x660 (ARABIC-INDIC DIGIT\nZERO), represents 0; ... 0x07C1 (NKO DIGIT ONE), represents 0+1-0 =\n1 ...\n\nThe fourth (index [3]) element ($default) in the list returned for\nthis format is the empty string.\n\n\"ale\"\nis a combination of the \"al\" type and the \"ae\" type. Some of the map\narray elements have the forms given by \"al\", and the rest are the\nempty string. The property \"NFKCCasefold\" has this form. An example\nslice is:\n\n@$rangesref  @$mapsref         Note\n...\n0x00AA       97                FEMININE ORDINAL INDICATOR => 'a'\n0x00AB        0\n0x00AD                         SOFT HYPHEN => \"\"\n0x00AE        0\n0x00AF     [ 0x0020, 0x0304 ]  MACRON => SPACE . COMBINING MACRON\n0x00B0        0\n...\n\nThe fourth (index [3]) element ($default) in the list returned for\nthis format is 0.\n\n\"ar\"\nmeans that all the elements of the map array are either rational\nnumbers or the string \"NaN\", meaning \"Not a Number\". A rational\nnumber is either an integer, or two integers separated by a solidus\n(\"/\"). The second integer represents the denominator of the division\nimplied by the solidus, and is actually always positive, so it is\nguaranteed not to be 0 and to not be signed. When the element is a\nplain integer (without the solidus), it may need to be adjusted to\nget the correct value by adding the offset, just as other \"a\"\nproperties. No adjustment is needed for fractions, as the range is\nguaranteed to have just a single element, and so the offset is\nalways 0.\n\nIf you want to convert the returned map to entirely scalar numbers,\nyou can use something like this:\n\nmy ($invlistref, $invmapref, $format) = propinvmap($property);\nif ($format && $format eq \"ar\") {\nmap { $ = eval $ if $ ne 'NaN' } @$mapref;\n}\n\nHere's some entries from the output of the property \"Nv\", which has\nformat \"ar\".\n\n@numericsranges  @numericsmaps       Note\n0x00           \"NaN\"\n0x30             0           DIGIT 0 .. DIGIT 9\n0x3A           \"NaN\"\n0xB2             2           SUPERSCRIPTs 2 and 3\n0xB4           \"NaN\"\n0xB9             1           SUPERSCRIPT 1\n0xBA           \"NaN\"\n0xBC            1/4          VULGAR FRACTION 1/4\n0xBD            1/2          VULGAR FRACTION 1/2\n0xBE            3/4          VULGAR FRACTION 3/4\n0xBF           \"NaN\"\n0x660            0           ARABIC-INDIC DIGIT ZERO .. NINE\n0x66A          \"NaN\"\n\nThe fourth (index [3]) element ($default) in the list returned for\nthis format is \"NaN\".\n\n\"n\" means the Name property. All the elements of the map array are\nsimple scalars, but some of them contain special strings that\nrequire more work to get the actual name.\n\nEntries such as:\n\nCJK UNIFIED IDEOGRAPH-<code point>\n\nmean that the name for the code point is \"CJK UNIFIED IDEOGRAPH-\"\nwith the code point (expressed in hexadecimal) appended to it, like\n\"CJK UNIFIED IDEOGRAPH-3403\" (similarly for\n\"CJK COMPATIBILITY IDEOGRAPH-<code point>\").\n\nAlso, entries like\n\n<hangul syllable>\n\nmeans that the name is algorithmically calculated. This is easily\ndone by the function \"charnames::viacode(code)\" in charnames.\n\nNote that for control characters (\"Gc=cc\"), Unicode's data files\nhave the string \"\"<control>\"\", but the real name of each of these\ncharacters is the empty string. This function returns that real\nname, the empty string. (There are names for these characters, but\nthey are considered aliases, not the Name property name, and are\ncontained in the \"NameAlias\" property.)\n\n\"ad\"\nmeans the DecompositionMapping property. This property is like \"al\"\nproperties, except that one of the scalar elements is of the form:\n\n<hangul syllable>\n\nThis signifies that this entry should be replaced by the\ndecompositions for all the code points whose decomposition is\nalgorithmically calculated. (All of them are currently in one range\nand no others outside the range are likely to ever be added to\nUnicode; the \"n\" format has this same entry.) These can be generated\nvia the function Unicode::Normalize::NFD().\n\nNote that the mapping is the one that is specified in the Unicode\ndata files, and to get the final decomposition, it may need to be\napplied recursively. Unicode in fact discourages use of this\nproperty except internally in implementations of the Unicode\nNormalization Algorithm.\n\nThe fourth (index [3]) element ($default) in the list returned for\nthis format is 0.\n\nNote that a format begins with the letter \"a\" if and only the property\nit is for requires adjustments by adding the offsets in multi-element\nranges. For all these properties, an entry should be adjusted only if\nthe map is a scalar which is an integer. That is, it must match the\nregular expression:\n\n/ ^ -? \\d+ $ /xa\n\nFurther, the first element in a range never needs adjustment, as the\nadjustment would be just adding 0.\n\nA binary search such as that provided by \"searchinvlist()\", can be used\nto quickly find a code point in the inversion list, and hence its\ncorresponding mapping.\n\nThe final, fourth element (index [3], assigned to $default in the\n\"block\" example) in the four element list returned by this function is\nused with the \"a\" format types; it may also be useful for applications\nthat wish to convert the returned inversion map data structure into some\nother, such as a hash. It gives the mapping that most code points map to\nunder the property. If you establish the convention that any code point\nnot explicitly listed in your data structure maps to this value, you can\npotentially make your data structure much smaller. As you construct your\ndata structure from the one returned by this function, simply ignore\nthose ranges that map to this value. For example, to convert to the data\nstructure searchable by \"charinrange()\", you can follow this recipe for\nproperties that don't require adjustments:\n\nmy ($listref, $mapref, $format, $default) = propinvmap($property);\nmy @rangelist;\n\n# Look at each element in the list, but the -2 is needed because we\n# look at $i+1 in the loop, and the final element is guaranteed to map\n# to $default by propinvmap(), so we would skip it anyway.\nfor my $i (0 .. @$listref - 2) {\nnext if $mapref->[$i] eq $default;\npush @rangelist, [ $listref->[$i],\n$listref->[$i+1],\n$mapref->[$i]\n];\n}\n\nprint charinrange(\\@rangelist, $codepoint), \"\\n\";\n\nWith this, \"charinrange()\" will return \"undef\" if its input code point\nmaps to $default. You can avoid this by omitting the \"next\" statement,\nand adding a line after the loop to handle the final element of the\ninversion map.\n\nSimilarly, this recipe can be used for properties that do require\nadjustments:\n\nfor my $i (0 .. @$listref - 2) {\nnext if $mapref->[$i] eq $default;\n\n# propinvmap() guarantees that if the mapping is to an array, the\n# range has just one element, so no need to worry about adjustments.\nif (ref $mapref->[$i]) {\npush @rangelist,\n[ $listref->[$i], $listref->[$i], $mapref->[$i] ];\n}\nelse {  # Otherwise each element is actually mapped to a separate\n# value, so the range has to be split into single code point\n# ranges.\n\nmy $adjustment = 0;\n\n# For each code point that gets mapped to something...\nfor my $j ($listref->[$i] .. $listref->[$i+1] -1 ) {\n\n# ... add a range consisting of just it mapping to the\n# original plus the adjustment, which is incremented for the\n# next time through the loop, as the offset increases by 1\n# for each element in the range\npush @rangelist,\n[ $j, $j, $mapref->[$i] + $adjustment++ ];\n}\n}\n}\n\nNote that the inversion maps returned for the \"CaseFolding\" and\n\"SimpleCaseFolding\" properties do not include the Turkic-locale\nmappings. Use \"casefold()\" for these.\n\n\"propinvmap\" does not know about any user-defined properties, and will\nreturn \"undef\" if called with one of those.\n\nThe returned values for the Perl extension properties, such as \"Any\" and\n\"Greek\" are somewhat misleading. The values are either \"Y\" or \"\"N\"\". All\nUnicode properties are bipartite, so you can actually use the \"Y\" or\n\"\"N\"\" in a Perl regular expression for these, like \"qr/\\p{IDStart=Y/}\"\nor \"qr/\\p{Upper=N/}\". But the Perl extensions aren't specified this way,\nonly like \"/qr/\\p{Any}\", *etc*. You can't actually use the \"Y\" and \"\"N\"\"\nin them.\n\nGetting every available name\nInstead of reading the Unicode Database directly from files, as you were\nable to do for a long time, you are encouraged to use the supplied\nfunctions. So, instead of reading \"Name.pl\" directly, which changed\nformats in 5.32, and may do so again without notice in the future or\neven disappear, you ought to use \"propinvmap()\" like this:\n\nmy (%name, %cp, %cps, $n);\n# All codepoints\nforeach my $cat (qw( Name NameAlias )) {\nmy ($codepoints, $names, $format, $default) = propinvmap($cat);\n# $format => \"n\", $default => \"\"\nforeach my $i (0 .. @$codepoints - 2) {\nmy ($cp, $n) = ($codepoints->[$i], $names->[$i]);\n# If $n is a ref, the same codepoint has multiple names\nforeach my $name (ref $n ? @$n : $n) {\n$name{$cp} //= $name;\n$cp{$name} //= $cp;\n}\n}\n}\n# Named sequences\n{   my %ns = namedseq();\nforeach my $name (sort { $ns{$a} cmp $ns{$b} } keys %ns) {\n$cp{$name} //= [ map { ord } split \"\" => $ns{$name} ];\n}\n}\n\nsearchinvlist()\nuse Unicode::UCD qw(propinvmap propinvlist);\nuse Unicode::UCD 'searchinvlist';\n\nmy @invlist = propinvlist($propertyname);\nprint $codepoint, ((searchinvlist(\\@invlist, $codepoint) // -1) % 2)\n? \" isn't\"\n: \" is\",\n\" in $propertyname\\n\";\n\nmy ($blocksrangesref, $blocksmapref) = propinvmap(\"Block\");\nmy $index = searchinvlist($blocksrangesref, $codepoint);\nprint \"$codepoint is in block \", $blocksmapref->[$index], \"\\n\";\n\n\"searchinvlist\" is used to search an inversion list returned by\n\"propinvlist\" or \"propinvmap\" for a particular \"code point argument\".\n\"undef\" is returned if the code point is not found in the inversion list\n(this happens only when it is not a legal \"code point argument\", or is\nless than the list's first element). A warning is raised in the first\ninstance.\n\nOtherwise, it returns the index into the list of the range that contains\nthe code point.; that is, find \"i\" such that\n\nlist[i]<= codepoint < list[i+1].\n\nAs explained in \"propinvlist()\", whether a code point is in the list or\nnot depends on if the index is even (in) or odd (not in). And as\nexplained in \"propinvmap()\", the index is used with the returned\nparallel array to find the mapping.\n",
            "subsections": [
                {
                    "name": "Unicode::UCD::UnicodeVersion",
                    "content": "This returns the version of the Unicode Character Database, in other\nwords, the version of the Unicode standard the database implements. The\nversion is a string of numbers delimited by dots ('.').\n"
                },
                {
                    "name": "Blocks versus Scripts",
                    "content": "The difference between a block and a script is that scripts are closer\nto the linguistic notion of a set of code points required to represent\nlanguages, while block is more of an artifact of the Unicode code point\nnumbering and separation into blocks of consecutive code points (so far\nthe size of a block is some multiple of 16, like 128 or 256).\n\nFor example the Latin script is spread over several blocks, such as\n\"Basic Latin\", \"Latin 1 Supplement\", \"Latin Extended-A\", and \"Latin\nExtended-B\". On the other hand, the Latin script does not contain all\nthe characters of the \"Basic Latin\" block (also known as ASCII): it\nincludes only the letters, and not, for example, the digits nor the\npunctuation.\n\nFor blocks see <http://www.unicode.org/Public/UNIDATA/Blocks.txt>\n\nFor scripts see UTR #24: <http://www.unicode.org/unicode/reports/tr24/>\n"
                },
                {
                    "name": "Matching Scripts and Blocks",
                    "content": "Scripts are matched with the regular-expression construct \"\\p{...}\"\n(e.g. \"\\p{Tibetan}\" matches characters of the Tibetan script), while\n\"\\p{Blk=...}\" is used for blocks (e.g. \"\\p{Blk=Tibetan}\" matches any of\nthe 256 code points in the Tibetan block).\n"
                },
                {
                    "name": "Old-style versus new-style block names",
                    "content": "Unicode publishes the names of blocks in two different styles, though\nthe two are equivalent under Unicode's loose matching rules.\n\nThe original style uses blanks and hyphens in the block names (except\nfor \"NoBlock\"), like so:\n\nMiscellaneous Mathematical Symbols-B\n\nThe newer style replaces these with underscores, like this:\n\nMiscellaneousMathematicalSymbolsB\n\nThis newer style is consistent with the values of other Unicode\nproperties. To preserve backward compatibility, all the functions in\nUnicode::UCD that return block names (except as noted) return the\nold-style ones. \"propvaluealiases()\" returns the new-style and can be\nused to convert from old-style to new-style:\n\nmy $newstyle = propvaluesaliases(\"block\", $oldstyle);\n\nPerl also has single-form extensions that refer to blocks,\n\"InCyrillic\", meaning \"Block=Cyrillic\". These have always been written\nin the new style.\n\nTo convert from new-style to old-style, follow this recipe:\n\n$oldstyle = charblock((propinvlist(\"block=$newstyle\"))[0]);\n\n(which finds the range of code points in the block using \"propinvlist\",\ngets the lower end of the range (0th element) and then looks up the old\nname for its block using \"charblock\").\n\nNote that starting in Unicode 6.1, many of the block names have shorter\nsynonyms. These are always given in the new style.\n"
                },
                {
                    "name": "Use with older Unicode versions",
                    "content": "The functions in this module work as well as can be expected when used\non earlier Unicode versions. But, obviously, they use the available data\nfrom that Unicode version. For example, if the Unicode version predates\nthe definition of the script property (Unicode 3.1), then any function\nthat deals with scripts is going to return \"undef\" for the script\nportion of the return value.\n"
                }
            ]
        },
        "AUTHOR": {
            "content": "Jarkko Hietaniemi. Now maintained by perl5 porters.\n",
            "subsections": []
        }
    },
    "summary": "Unicode::UCD - Unicode character database",
    "flags": [],
    "examples": [],
    "see_also": []
}