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

big5.reader

 
 

Library: Big5 (OMFFBIG5)
Import: omffbig5.xmd
Return type: String source

Returns: A scannable input source for streaming data.


Declaration

export external string source function reader
                  from value string source input-data


Purpose

Use reader to read a value string source, its argument, and return the text of that file converted from a Big 5 encoding to a UTF-8 encoding. That is, the provided source is in Big 5, but the program sees UTF-8

Usage Note

To use reader, you must import omffbig5.xmd into your program using a statement like this:

  import "omffbig5.xmd" prefixed by big5.

(Please see the import topic for more on importing.)

Example


  ; Scan the Big Five-encoded file named by the first
  ; command-line argument to the program's find rules,
  ; converting from Big Five to UTF-8 prior to the match
  ; alternatives seeing the data:
  import "omffbig5.xmd" prefixed by big5.
  process
     repeat scan big5.reader from file #args [1]
     match ["%0#"  to "%127"]+ => plain-ascii
        output plain-ascii
     match (any ["%128#" to "#255#"]+) => utf-8-code
        ; process utf-8-code
     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.