mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 14:30:34 +02:00
Preserve the case of the user-specified port encoding string.
* libguile/ports.c (scm_i_set_port_encoding_x): Always copy the user-provided port encoding string, so that its case will be preserved and returned exactly by subsequent calls to 'port-encoding'.
This commit is contained in:
parent
c3e3ef6eb6
commit
4120539225
1 changed files with 1 additions and 2 deletions
|
@ -2385,7 +2385,6 @@ scm_i_set_port_encoding_x (SCM port, const char *encoding)
|
|||
descriptor. */
|
||||
if (strcasecmp (encoding, "UTF-8") == 0)
|
||||
{
|
||||
pt->encoding = "UTF-8";
|
||||
pti->encoding_mode = SCM_PORT_ENCODING_MODE_UTF8;
|
||||
pti->iconv_descriptors = NULL;
|
||||
}
|
||||
|
@ -2396,9 +2395,9 @@ scm_i_set_port_encoding_x (SCM port, const char *encoding)
|
|||
open_iconv_descriptors (encoding,
|
||||
SCM_INPUT_PORT_P (port),
|
||||
SCM_OUTPUT_PORT_P (port));
|
||||
pt->encoding = scm_gc_strdup (encoding, "port");
|
||||
pti->encoding_mode = SCM_PORT_ENCODING_MODE_ICONV;
|
||||
}
|
||||
pt->encoding = scm_gc_strdup (encoding, "port");
|
||||
|
||||
if (prev)
|
||||
close_iconv_descriptors (prev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue