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

jis.writer

 
 

Library: JIS (OMFFJIS)
Import: omffjis.xmd
Return type: String sink

Returns: A writable output target for streaming data.


Declaration

export external string sink function writer
       escape-sequence value string escape-sequence
                       optional initial {'%27#$B'}
                  into value string sink output-data



Purpose

Use writerto accept UTF-8 encoded data and write that data to a value string sink, heralded by into, converted from a UTF-8 encoding to a JIS encoding. That is, the program writes UTF-8, but the provided output receives JIS.

writer has an optional first argument, heralded by escape-sequence that is the escape sequence used to switch into two-byte JIS X 0208/JIS C 6226 mode. It must be at least one byte long and no more than eight bytes long if specified.

Usage Note

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

  import "omffjis.xmd" prefixed by jis.

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

Example


  ; Write a JIS-encoded file named by the first command-line
  ; argument using the stream named "output-file".  Convert
  ; the data from UTF-8 to JIS prior to writing it to the file.
  import "omffjis.xmd" prefixed by jis.
  process
     local stream output-file
     open output-file as jis.writer into file #args [1]

        Other Library Functions
   jis.reader
   jis.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.