swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
pattern  

utf8.multi-byte-char

 
 

Library: UTF-8 (OMUTF8)
Import: omutf8.xmd

Declaration

export switch function 
   multi-byte-char overlong-handling value error-handling-type overlong-handling optional
     elsewhere
    


Purpose

The function utf8.multi-byte-char matches only multi-byte UTF-8 encoded characters (those with numeric values greater than 128). By default, utf8.multi-byte-char will not match overlong values. You can change this behavior by specifying the overlong-handling variable as allowed. If overlong-handling is specified as not-allowed-with-throw, an overlong value will trigger a throw to utf8.overlong-sequence. If it is not specified, or specified as not-allowed, overlong sequences are not matched and the pattern functions will return false.

Example:


  import "omutf8.xmd" prefixed by utf8.
  
  process
     repeat scan "flamb%195#%169#"
     match utf8.single-byte-char+ => c
        output c
  
     match utf8.multi-byte-char => c
        local integer n initial { utf8.code-point of c }
  
        do when n > 255
           output "&#x" || "16rud" % n || ";"
  
        else
           output "b" % n
        done
    again
            

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.