swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

big5.reader

 
 

Library: Character encodings, Big five (OMFFBIG5)
Import: omffbig5.xmd
Return type: Source
Returns: 

A scannable input source for streaming data.


Declaration

  export external source function reader
                    from value source input-data


Purpose

Use reader to read a value 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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:44:59 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.