mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* 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. |
||
---|---|---|
.. | ||
.gitignore | ||
api-binding.texi | ||
api-compound.texi | ||
api-control.texi | ||
api-coverage.texi | ||
api-data.texi | ||
api-debug.texi | ||
api-deprecated.texi | ||
api-evaluation.texi | ||
api-foreign.texi | ||
api-i18n.texi | ||
api-init.texi | ||
api-io.texi | ||
api-lalr.texi | ||
api-languages.texi | ||
api-macros.texi | ||
api-memory.texi | ||
api-modules.texi | ||
api-options.texi | ||
api-overview.texi | ||
api-procedures.texi | ||
api-regex.texi | ||
api-scheduling.texi | ||
api-scm.texi | ||
api-smobs.texi | ||
api-snarf.texi | ||
api-undocumented.texi | ||
api-utility.texi | ||
api.txt | ||
ChangeLog-2008 | ||
ChangeLog-goops-2008 | ||
ChangeLog-guile-doc-ref | ||
compiler.texi | ||
curried.texi | ||
data-rep.texi | ||
effective-version.texi.in | ||
expect.texi | ||
fdl.texi | ||
gds.dia | ||
gds.eps | ||
gds.pdf | ||
gds.txt | ||
goops-tutorial.texi | ||
goops.texi | ||
guile-invoke.texi | ||
guile.texi | ||
hierarchy.dot | ||
hierarchy.eps | ||
hierarchy.pdf | ||
hierarchy.png | ||
hierarchy.txt | ||
history.texi | ||
indices.texi | ||
intro.texi | ||
libguile-autoconf.texi | ||
libguile-concepts.texi | ||
libguile-extensions.texi | ||
libguile-linking.texi | ||
libguile-parallel.texi | ||
libguile-program.texi | ||
libguile-smobs.texi | ||
libguile-snarf.texi | ||
Makefile.am | ||
match.texi | ||
misc-modules.texi | ||
mod-getopt-long.texi | ||
mop.text | ||
new-docstrings.texi | ||
posix.texi | ||
preface.texi | ||
r6rs.texi | ||
repl-modules.texi | ||
scheme-ideas.texi | ||
scheme-indices.texi | ||
scheme-intro.texi | ||
scheme-reading.texi | ||
scheme-scripts.texi | ||
scheme-using.texi | ||
scheme.dia | ||
scheme.eps | ||
scheme.pdf | ||
scheme.txt | ||
scsh.texi | ||
slib.texi | ||
srfi-modules.texi | ||
statprof.texi | ||
sxml-match.texi | ||
sxml.texi | ||
texinfo.texi | ||
tools.texi | ||
tour.texi | ||
vm.texi | ||
web.texi |