Next: , Previous: , Up: iklib io   [Index]


6.44.2 Transcoders and additional codecs

The following bindings are exported by the (vicare) library.

Function: transcoder? obj

Return #t if obj is a transcoder, else return #f.

Function: list-of-transcoders? obj

Return #t if obj is a list of transcoders, else return #f.

Parameter: native-transcoder

The function native-transcoder defined by R6RS returns a transcoder representing acceptable defaults for the platform on which the Scheme implementation is running. Under Vicare such default is:

(make-transcoder (utf-8-codec) (native-eol-style) 'replace)

and additionally the function is a parameter, so the default can be configured. Notice that the following functions create Scheme ports using the transcoder returned by native-transcoder:

open-input-file         open-output-file
with-input-from-file    with-output-to-file
call-with-input-file    call-with-output-file
Function: transcoder=? tran0 tran
Function: transcoder!=? tran0 tran
Function: transcoder<? tran0 tran
Function: transcoder>? tran0 tran
Function: transcoder<=? tran0 tran
Function: transcoder>=? tran0 tran

Compare the given transcoders and return #t or #f.

Function: transcoder-min tran0 tran
Function: transcoder-max tran0 tran

Return the minimum or maximum transcoder among the arguments.

Function: transcoder-hash tran

Hash function for transcoder objects.

The codec returned by utf-16-codec, defined by R6RS, has different semantics depending upon the type of the port:

Procedure: utf-16le-codec
Procedure: utf-16be-codec

Codecs for the UTF-16 encoding schemes, little endian and big endian. A call to any of these procedures returns a value that is equal in the sense of eqv? to the result of any other call to the same procedure.

Procedure: utf-16n-codec

Return a codec for the UTF-16 encoding scheme, with endianness equal to the one returned by (native-endianness). A call to this procedure returns a value that is equal in the sense of eqv? to the result of any other call to the same procedure.

Procedure: utf-bom-codec

Codec for UTF encoding schemes whose data open with a Byte Order Mark. A call to this procedure returns a value that is equal in the sense of eqv? to the result of any other call to the same procedure.

At present this codec is supported only by input ports.


Footnotes

(2)

The big endian BOM for UTF-16 is the sequence of bytes #xFE #xFF; the little endian BOM for UTF-16 is the sequence of bytes #xFF #xFE.


Next: , Previous: , Up: iklib io   [Index]