Previous: , Up: syslib bytevectors   [Index]


12.17.8 Encodings

Function: $octets-encoded-bytevector? bv

Always return #t.

Function: $ascii-encoded-bytevector? bv

Return #t if bv can be interpreted as an ASCII encoded string, otherwise return #f. An octet chi is considered an ASCII code point if:

(<= #x00 chi #x7F)      ⇒ #t
Function: $latin1-encoded-bytevector? bv

Return #t if bv can be interpreted as a Latin-1 encoded string, otherwise return #f. An octet chi is considered a Latin1 code point if:

(or (<= #x20 chi #x7E)
    (<= #xA0 chi #xFF))
⇒ #t
Function: $uri-encode bv
Function: $uri-decode bv

Encode or decode a bytevector bv according to RFC 3986 URI percent encoding; return a bytevector. All the octets are encoded except the ones having the following ASCII representation:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789
-._~
Function: $uri-normalise-encoding bv

Given a bytevector bv encoded according to to RFC 3986 URI percent encoding: return an encoded and normalised bytevector, octets that are encoded but should not are decoded.

Function: $uri-encoded-bytevector? bv
Function: $percent-encoded-bytevector? bv

Return #t if the argument is a correctly percent–encoded bytevector according to RFC 3986.

Function: $base64->bytevector bv
Function: $bytevector->base64 bv

Convert to and from a Scheme bytevector containing octets and a Scheme bytevector containing the ASCII Base64 representation of the octets. If an error occurs in the conversion: the return value is #f.