jis.writer

function

Library: JIS (OMFFJIS)
Import : omffjis.xmd

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 jis.writer to accept UTF-8 encoded data and write that data to its value string sink output-data argument, converted from a UTF-8 encoding to a JIS encoding. That is, the program writes UTF-8, but the provided output receives JIS.

jis.writer has an optional first argument, 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.

Example

The following program uses jis.writer to convert the output of find rules from UTF-8 to JIS, and send the result to #main-output.

  import "omffjis.xmd" prefixed by jis.
  
  process
     using group "process input"
        using output as jis.writer into #main-output
           submit #main-input
  
  group "process input"
     ; ...

Usage Note

To use jis.writer, you must import OMFFJIS into your program using an import declaration such as:

  import "omffjis.xmd" prefixed by jis.

Other Library Functions