swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
pattern  

single-byte-utf8-char

 
 

Library: UTF-8 text processing legacy library (UTF8PAT)
Include: utf8pat.xin

Declaration

single-byte-utf8-char


Purpose

You can use single-byte-utf8-char as a pattern to match only ASCII UTF-8 encoded characters (those with numeric values 0 to 127) in your input data.

In most cases, you may be able to use just the companion to this syntax item, multi-byte-utf8-char to process multi-byte utf8 characters separately. However, there may be cases where you want to use single-byte-utf8-char+ to match single-byte UTF-8 characters and throw them away, for example.

Example:

  include "utf8pat.xin"
    process
    repeat scan "flamb%195#%169#"
         match single-byte-utf8-char+ => c
              output c
         match multi-byte-utf8-char => c
              local integer n initial {utf8-char-number c}
              do when n > 255
                   output "&#x" || "16rud" % n || ";"
              else
                   output "b" % n
              done
      again

For other related constants and keywords, see the UTF-8 text processing legacy library.

        Other Library Functions
   multi-byte-utf8-char
   single-byte-utf8-char
   utf8-char
   utf8-char-number
   utf8-encoded
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.