unicode.block-name

function

Library: Unicode (OMUNICODE)
Import : omunicode.xmd

Returns: The name of the argument character's Unicode block.


Declaration
export string function
   block-name of value integer character


Purpose

Use unicode.block-name to find the block property of a character code point, as defined in Unicode 5.1.0.

Example

The pattern function greek () in the following example demonstrates how to use the unicode.block-name function to match a Greek combined character:

  import "omunicode.xmd" prefixed by unicode.
  import "omutf8.xmd"    prefixed by utf8.
  
  define switch function
     greek ()
  as
     repeat scan #current-input
     match utf8.char => character
           (when unicode.block-name of utf8.code-point of character matches "Combining Diacritical Marks")
  
     match utf8.char => character
           (when unicode.block-name of utf8.code-point of character = ("Greek and Coptic" | "Greek Extended"))
        return true
     again
  
     return false

Usage Note

To use unicode.block-name, you must import OMUNICODE into your program using an import declaration such as:

  import "omunicode.xmd" prefixed by unicode.