(type egg)
(signature "iconv egg")
(timestamp 1677127083)
(sxml ((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/iconv" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "eggs" "iconv" "charset" "characters")) (section 2 "iconv" (section 3 "Introduction" (p "Allows conversion of multi-byte sequences from one character set (encoding) to another by means of the iconv functionality present in glibc (and thus is probably not very portable).")) (section 3 "Examples" (section 4 "Converting" (highlight scheme "(import iconv)\n\n; First we obtain a converter procedure.  In this case we will convert\n; from latin1 to utf-8:\n\n(define latin1->utf8 (make-iconv \"utf-8\" \"latin1\"))\n\n; Read lines from the input, convert them and write them:\n\n(let loop ((line (read-line)))\n  (unless (eof-object? line)\n    (display (latin1->utf8 line))\n    (newline)\n    (loop (read-line))))"))) (section 3 "Authors" (p "This egg was created by " (int-link "Alejandro Forero Cuervo") ".")) (section 3 "License" (p "The iconv egg for Chicken Scheme is in the public domain and may be reproduced or copied without permission from its author.  Citation of the source is appreciated.")) (section 3 "Conversion" (section 4 "make-iconv" (pre "[procedure] (make-iconv TOCODE FROMCODE)") (p "Create a converter procedure suitable for converting byte sequences from character encoding " (tt "FROMCODE") " (a string) to character encoding " (tt "TOCODE") " (a string).") (p "The values permitted for " (tt "FROMCODE") " and " (tt "TOCODE") " and the supported combinations are system dependent.  For  the  GNU  C library,  the permitted values are listed by the " (tt "iconv --list") " command, and all combinations of the listed values are supported.") (p "The returned procedure takes a string encoded in " (tt "FROMCODE") " and returns a new string encoded in " (tt "TOCODE") ".") (p "The resulting converter procedure can be used any number of times."))) (section 3 "Version history" (dl (dt "2.0") (dd "Port to CHICKEN 5, simplify API. [Chris Brannon]") (dt "1.5") (dd "Use of 'foreign-safe-lambda*'. [Kon Lovett]") (dt "1.4") (dd "Links with libiconv when " (tt "(software-version)") " is " (tt "unknown") ".  This is the case of Cygwin, which requires libiconv.  This was suggested by Dekai Wu.") (dt "1.3") (dd "Links with libiconv on Mac OS X.") (dt "1.2") (dd "Uses callback to allocate result buffer.") (dt "1.1") (dd "First release."))))))
