Changeset 39432 in project


Ignore:
Timestamp:
12/17/20 20:20:45 (4 weeks ago)
Author:
dieggsy
Message:

Add to docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/icu

    r39431 r39432  
    1616=== Procedures
    1717
     18==== Names
    1819<procedure>(char-from-name name)</procedure>
    1920Return char corresponding to string name {{name}}. {{name}} is passed through
     
    3132(char-string-name #\x1f525) ;; => "FIRE"
    3233</enscript>
     34
     35==== Decomposition and Normalization
     36
     37<procedure>(char-decomposition char)</procedure>
     38
     39Returns the decomposition mapping of {{char}}.
     40
     41For example, for ÂŒ, VULGAR FRACTION ONE QUARTER:
     42<enscript highlight="scheme">
     43(char-decomposition #\xBC) ;; => '(#\1 #\x2044 #\4)
     44</enscript>
     45
     46<procedure>(string-normalize str [form])</procedure>
     47
     48Returns the normalized form of {{str}} to the destination string according to
     49{{form}}, which can be any of {{"nfc"}}, {{"nfkc"}}, {{"nfd"}}, or "{{nfkd}}"
     50
     51<enscript highlight="scheme">
     52(string-normalize "ÂŒ") ;; => "1/4"
     53</enscript>
     54
     55==== Numbers
     56<procedure>(char-digit-value char)</procedure>
     57Binding for {{u_charDigitValue}}. Returns the decimal digit value of a decimal
     58digit character.
     59
     60<enscript highlight="scheme">
     61(char-digit-value #\4) ;; => 4
     62</enscript>
     63
     64<procedure>(char-numeric-value char)</procedure>
     65Binding for {{u_getNumericValue}}. Get the numeric value (as a double) for a
     66Unicode code point as defined in the Unicode Character Database.
     67
     68<enscript highlight="scheme">
     69(char-numeric-value #\4) ;; => 4.0
     70(char-numeric-value #\xBC) ;; => .25
     71</enscript>
     72
     73<procedure>(char-digit char radix)</procedure>
     74
     75Binding for {{u_digit}}. Returns the decimal digit value of the code point in
     76the specified radix.
     77
     78<enscript highlight="scheme">
     79(char-digit #\f 16) ;; => 15
     80</enscript>
     81
     82<procedure>(char-for-digit char radix)</procedure>
     83
     84Binding for {{u_forDigit}}. Determines the character representation for a
     85specific digit in the specified radix.
     86
     87<enscript highlight="scheme">
     88(char-for-digit 15 16) ;; => #\f
     89</enscript>
     90
     91<procedure>(char-digit? char)</procedure>
     92
     93Binding for {{u_isdigit}}. Determines whether the specified code point is a
     94digit character according to Java.
     95
     96<procedure>(char-xdigit? char)</procedure>
     97
     98Binding for {{u_isxdigit}}. Determines whether the specified code point is a
     99hexadecimal digit.
Note: See TracChangeset for help on using the changeset viewer.