summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-01-11 21:28:51 +0100
committerAndy Wingo <wingo@pobox.com>2013-01-11 21:28:51 +0100
commit18c5bffe96947ee82a29b115e758d7357cefbbe9 (patch)
tree5199e2a1ebd8b4e51efde2769df59cae3950f36d
parent5ed4ea90a9abe64c024bbc0c664476b0673556b3 (diff)
downloadguile-18c5bffe96947ee82a29b115e758d7357cefbbe9.tar.gz
Docstrings in (ice-9 iconv)
* module/ice-9/iconv.scm: Add docstrings.
-rw-r--r--module/ice-9/iconv.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/module/ice-9/iconv.scm b/module/ice-9/iconv.scm
index 0f0c1a3cf..a8b745896 100644
--- a/module/ice-9/iconv.scm
+++ b/module/ice-9/iconv.scm
@@ -45,6 +45,8 @@
(define* (call-with-encoded-output-string encoding proc
#:optional
(conversion-strategy 'error))
+ "Call PROC on a fresh port. Encode the resulting string as a
+bytevector according to ENCODING, and return the bytevector."
(if (string-ci=? encoding "utf-8")
;; I don't know why, but this appears to be faster; at least for
;; serving examples/debug-sxml.scm (1464 reqs/s versus 850
@@ -62,6 +64,8 @@
(define* (string->bytevector str encoding
#:optional (conversion-strategy 'error))
+ "Encode STRING according to ENCODING, which should be a string naming
+a character encoding, like \"utf-8\"."
(if (string-ci=? encoding "utf-8")
(string->utf8 str)
(call-with-encoded-output-string
@@ -72,6 +76,9 @@
(define* (bytevector->string bv encoding
#:optional (conversion-strategy 'error))
+ "Decode the string represented by BV. The bytes in the bytevector
+will be interpreted according to ENCODING, which should be a string
+naming a character encoding, like \"utf-8\"."
(if (string-ci=? encoding "utf-8")
(utf8->string bv)
(let ((p (open-bytevector-input-port bv)))