swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     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 Syntax
   big5.writer
 
  Other Library Functions
   big5.reader
   big5.writer
 
 

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.