|  | 
 | ||||
|        | |||||
|  | ||||||
| Related Syntax | Related Concepts | Other Library Functions | ||||
| pattern | utf8.single-byte-char | 
| Library: UTF-8 (OMUTF8) Import: omutf8.xmd | 
utf8.single-byte-char
You can use utf8.single-byte-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, utf8.multi-byte-char to process multi-byte utf8 characters separately. However, there may be cases where you want to use utf8.single-byte-char+ to match single-byte UTF-8  characters and throw them away, for 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
For other related constants and keywords, see the UTF-8 text processing library.
| Related Syntax utf8.char | Related Concepts Character set encoding Pattern matching | Other Library Functions utf8.byte-order-mark utf8.char utf8.code-point utf8.encoding utf8.multi-byte-char utf8.omutf8-version utf8.single-byte-char | 
Copyright © Stilo International plc, 1988-2008.