1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00
guile/doc/ref
Mark H Weaver cdd3d6c9f4 Improve handling of Unicode byte-order marks (BOMs).
* libguile/ports-internal.h (struct scm_port_internal): Add new members
  'at_stream_start_for_bom_read' and 'at_stream_start_for_bom_write'.
  (SCM_UNICODE_BOM): New macro.
  (scm_i_port_iconv_descriptors): Add 'mode' parameter to prototype.

* libguile/ports.c (scm_new_port_table_entry): Initialize
  'at_stream_start_for_bom_read' and 'at_stream_start_for_bom_write'.
  (get_iconv_codepoint): Pass new 'mode' parameter to
  'scm_i_port_iconv_descriptors'.
  (get_codepoint): After reading a codepoint at stream start, record
  that we're no longer at stream start, and consume a BOM where
  appropriate.
  (scm_seek): Set the stream start flags according to the new position.
  (looking_at_bytes): New static function.
  (scm_utf8_bom, scm_utf16be_bom, scm_utf16le_bom, scm_utf32be_bom,
  scm_utf32le_bom): New static const arrays.
  (decide_utf16_encoding, decide_utf32_encoding): New static functions.
  (scm_i_port_iconv_descriptors): Add new 'mode' parameter.  If the
  specified encoding is UTF-16 or UTF-32, make that precise by deciding
  what byte order to use, and construct iconv descriptors based on the
  precise encoding.
  (scm_i_set_port_encoding_x): Record that we are now at stream start.
  Do not open the new iconv descriptors immediately; let them be
  initialized lazily.

* libguile/print.c (display_string_using_iconv): Record that we're no
  longer at stream start.  Write a BOM if appropriate.

* doc/ref/api-io.texi (BOM Handling): New node.

* test-suite/tests/ports.test ("set-port-encoding!, wrong encoding"):
  Adapt test to cope with the fact that 'set-port-encoding!' does not
  immediately open the iconv descriptors.
  (bv-read-test): New procedure.
  ("unicode byte-order marks (BOMs)"): New test prefix.
2013-04-04 21:40:28 -04:00
..
.gitignore add www-commit rule in doc/ref 2010-12-17 16:41:58 +01:00
api-binding.texi docs: fix typos in manual, and a couple in code comments. 2011-02-09 22:28:49 +00:00
api-compound.texi Cross reference 'SRFI-9 Records' directly instead of 'SRFI-9'. 2013-04-04 03:21:40 -04:00
api-control.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
api-coverage.texi Manual sections don't need a page break before 2010-10-31 08:34:05 +00:00
api-data.texi Fix broken texinfo markup in (ice-9 iconv) docs. 2013-04-01 12:35:24 -04:00
api-debug.texi Improve keyword notation of Texinfo function definitions. 2013-03-02 20:34:29 +01:00
api-deprecated.texi
api-evaluation.texi Document (system repl server) 2013-03-28 19:15:26 +00:00
api-foreign.texi update old references in FFI doc 2013-02-14 10:45:27 +01:00
api-i18n.texi
api-init.texi
api-io.texi Improve handling of Unicode byte-order marks (BOMs). 2013-04-04 21:40:28 -04:00
api-lalr.texi Manual sections don't need a page break before 2010-10-31 08:34:05 +00:00
api-languages.texi
api-macros.texi fix doc build 2013-03-15 19:22:18 +01:00
api-memory.texi Make notation for Scheme repeated arguments more consistent in manual. 2012-02-04 00:10:13 +01:00
api-modules.texi Cross reference 'SRFI-9 Records' directly instead of 'SRFI-9'. 2013-04-04 03:21:40 -04:00
api-options.texi build: Build and check (ice-9 popen) only when --enable-posix and HAVE_FORK. 2013-03-29 19:20:01 +01:00
api-overview.texi Manual typo fix 2010-12-23 12:17:26 +00:00
api-procedures.texi Nicer docstring syntax for case-lambda. 2013-04-04 15:22:18 -04:00
api-regex.texi doc: Fix description of regexp/locale encoding interaction. 2012-08-27 00:09:30 +02:00
api-scheduling.texi futures: Limit the number of nested futures on the same stack. 2013-03-27 18:09:49 +01:00
api-scm.texi
api-smobs.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
api-snarf.texi
api-undocumented.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
api-utility.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
api.txt
ChangeLog-2008
ChangeLog-goops-2008
ChangeLog-guile-doc-ref
compiler.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
curried.texi Document (ice-9 curried definitions) 2012-09-06 22:15:40 +01:00
data-rep.texi Clarify docs for SCM_UNSPECIFIED: used sometimes but not always 2011-05-25 12:40:55 -04:00
effective-version.texi.in
expect.texi
fdl.texi
gds.dia
gds.eps
gds.pdf
gds.txt
goops-tutorial.texi Merge tutorial' and reference' treatments of the same basic GOOPS 2010-12-06 22:28:39 +00:00
goops.texi Make notation for Scheme repeated arguments more consistent in manual. 2012-02-04 00:10:13 +01:00
guile-invoke.texi Add -C command-line option to adjust %load-compiled-path. 2013-03-30 22:49:46 -04:00
guile.texi doc: Rename "Texinfo" node to "Texinfo Processing". 2013-03-04 09:04:16 +01:00
hierarchy.dot doc/ref/hierarchy.png: conform to hierarchy.txt and manual 2013-01-15 19:17:55 +01:00
hierarchy.eps doc/ref/hierarchy.png: conform to hierarchy.txt and manual 2013-01-15 19:17:55 +01:00
hierarchy.pdf doc/ref/hierarchy.png: conform to hierarchy.txt and manual 2013-01-15 19:17:55 +01:00
hierarchy.png doc/ref/hierarchy.png: conform to hierarchy.txt and manual 2013-01-15 19:17:55 +01:00
hierarchy.txt
history.texi doc: Set document encoding to UTF-8; typeset my surname correctly. 2011-12-14 22:26:15 +01:00
indices.texi Procedure/macro index includes Autoconf macros 2011-02-13 22:28:25 +00:00
intro.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
libguile-autoconf.texi manual: reorganize autoconf, pkg-config info 2011-10-12 17:12:29 +02:00
libguile-concepts.texi libguile examples use scm_c_vector functions instead of SCM_SIMPLE_VECTOR_* 2013-01-22 12:05:32 +01:00
libguile-extensions.texi @value{EFFECTIVE-VERSION} instead of 2.0 in some places in the manual 2011-02-20 13:16:37 +01:00
libguile-linking.texi manual: reorganize autoconf, pkg-config info 2011-10-12 17:12:29 +02:00
libguile-parallel.texi doc: Document the sitedir' and extensiondir' pkg-config variables. 2011-10-22 16:11:01 +02:00
libguile-program.texi Make the "Dia Primitives" section of the manual more clear. 2011-12-22 09:32:09 -05:00
libguile-smobs.texi documentation recommends scm_new_smob instead of SCM_NEWSMOB 2013-01-22 12:05:32 +01:00
libguile-snarf.texi no need to warn people off of s_FOO generated by SCM_DEFINE 2012-01-08 17:55:01 +01:00
Makefile.am Avoid rebuild of `guile.info' at the user's site. 2013-03-18 22:30:13 +01:00
match.texi doc: Strengthen the case for pattern matching. 2012-11-17 16:14:02 +01:00
misc-modules.texi Add full documentation for SRFI-41. 2013-03-27 13:37:45 -04:00
mod-getopt-long.texi rename guile-tools' to guild' 2011-05-31 22:01:47 +02:00
mop.text
new-docstrings.texi
posix.texi build: Build and check (ice-9 popen) only when --enable-posix and HAVE_FORK. 2013-03-29 19:20:01 +01:00
preface.texi doc: Set document encoding to UTF-8; typeset my surname correctly. 2011-12-14 22:26:15 +01:00
r6rs.texi Cross reference 'SRFI-9 Records' directly instead of 'SRFI-9'. 2013-04-04 03:21:40 -04:00
repl-modules.texi fix documentation for option-set! syntaxen 2011-05-20 11:54:46 +02:00
scheme-ideas.texi Document (ice-9 curried definitions) 2012-09-06 22:15:40 +01:00
scheme-indices.texi
scheme-intro.texi
scheme-reading.texi fix urls in docs 2011-11-16 23:21:59 +01:00
scheme-scripts.texi better invocation documentation 2011-06-30 13:19:04 +02:00
scheme-using.texi add %site-ccache-dir 2013-03-10 23:20:22 +01:00
scheme.dia
scheme.eps
scheme.pdf
scheme.txt
scsh.texi
slib.texi docs: fix typos in manual, and a couple in code comments. 2011-02-09 22:28:49 +00:00
srfi-modules.texi doc: Use '@defvr' to introduce 'stream-null'. 2013-03-29 11:35:20 -04:00
statprof.texi an end to the generated-documentation experiment 2013-01-16 10:03:44 +01:00
sxml-match.texi begin rewriting SXML docs 2013-01-28 10:52:44 +01:00
sxml.texi excise use of "iff" in the manual 2013-03-10 22:29:18 +01:00
texinfo.texi doc: Rename "Texinfo" node to "Texinfo Processing". 2013-03-04 09:04:16 +01:00
tools.texi doc: Mention the former name of `guild'. 2011-06-08 23:19:37 +02:00
tour.texi doc: Use scm_{to,from}_double instead of old API in example. 2012-09-03 22:35:33 +02:00
vm.texi case-lambda* clauses fail to match if too many positionals 2013-01-14 11:38:09 +01:00
web.texi minor tweaks to web documentation 2013-03-16 17:53:53 +08:00