Warning: This is the manual of the legacy Guile 2.2 series. You may want to read the manual of the current stable series instead.
Next: Bytevectors as Arrays, Previous: Bytevectors as Floats, Up: Bytevectors [Contents][Index]
Bytevector contents can also be interpreted as Unicode strings encoded in one of the most commonly available encoding formats. See Representing Strings as Bytes, for a more generic interface.
(utf8->string (u8-list->bytevector '(99 97 102 101))) ⇒ "cafe" (string->utf8 "café") ;; SMALL LATIN LETTER E WITH ACUTE ACCENT ⇒ #vu8(99 97 102 195 169)
Return the number of bytes in the UTF-8 representation of str.
Return a newly allocated bytevector that contains the UTF-8, UTF-16, or
UTF-32 (aka. UCS-4) encoding of str. For UTF-16 and UTF-32,
endianness should be the symbol big
or little
; when omitted,
it defaults to big endian.
Return a newly allocated string that contains from the UTF-8-, UTF-16-,
or UTF-32-decoded contents of bytevector utf. For UTF-16 and UTF-32,
endianness should be the symbol big
or little
; when omitted,
it defaults to big endian.