#include <uniconv.h>
#include <unistr.h>
#include <striconveh.h>
+#include <c-strcase.h>
#include <assert.h>
encoding = scm_i_default_port_encoding ();
entry->ilseq_handler = scm_i_default_port_conversion_handler ();
entry->encoding = encoding ? scm_gc_strdup (encoding, "port") : NULL;
- if (encoding && strcasecmp (encoding, "UTF-8") == 0)
+ if (encoding && c_strcasecmp (encoding, "UTF-8") == 0)
pti->encoding_mode = SCM_PORT_ENCODING_MODE_UTF8;
else
pti->encoding_mode = SCM_PORT_ENCODING_MODE_ICONV;
if (SCM_UNLIKELY
(*codepoint == SCM_UNICODE_BOM
&& (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8
- || strcasecmp (pt->encoding, "UTF-16") == 0
- || strcasecmp (pt->encoding, "UTF-32") == 0)))
+ || c_strcasecmp (pt->encoding, "UTF-16") == 0
+ || c_strcasecmp (pt->encoding, "UTF-32") == 0)))
return get_codepoint (port, codepoint, buf, len);
}
update_port_lf (*codepoint, port);
SCM_EOL);
if (encoding == NULL
- || !strcasecmp (encoding, "ASCII")
- || !strcasecmp (encoding, "ANSI_X3.4-1968")
- || !strcasecmp (encoding, "ISO-8859-1"))
+ || c_strcasecmp (encoding, "ASCII") == 0
+ || c_strcasecmp (encoding, "ANSI_X3.4-1968") == 0
+ || c_strcasecmp (encoding, "ISO-8859-1") == 0)
scm_fluid_set_x (SCM_VARIABLE_REF (default_port_encoding_var), SCM_BOOL_F);
else
scm_fluid_set_x (SCM_VARIABLE_REF (default_port_encoding_var),
/* If the specified encoding is UTF-16 or UTF-32, then make
that more precise by deciding what byte order to use. */
- if (strcasecmp (pt->encoding, "UTF-16") == 0)
+ if (c_strcasecmp (pt->encoding, "UTF-16") == 0)
precise_encoding = decide_utf16_encoding (port, mode);
- else if (strcasecmp (pt->encoding, "UTF-32") == 0)
+ else if (c_strcasecmp (pt->encoding, "UTF-32") == 0)
precise_encoding = decide_utf32_encoding (port, mode);
else
precise_encoding = pt->encoding;
because we do I/O ourselves. This saves 100+ KiB for each
descriptor. */
pt->encoding = scm_gc_strdup (encoding, "port");
- if (strcasecmp (encoding, "UTF-8") == 0)
+ if (c_strcasecmp (encoding, "UTF-8") == 0)
pti->encoding_mode = SCM_PORT_ENCODING_MODE_UTF8;
else
pti->encoding_mode = SCM_PORT_ENCODING_MODE_ICONV;
#include <uniconv.h>
#include <unictype.h>
+#include <c-strcase.h>
#include "libguile/_scm.h"
#include "libguile/chars.h"
pti->at_stream_start_for_bom_read = 0;
/* Write a BOM if appropriate. */
- if (SCM_UNLIKELY (strcasecmp(pt->encoding, "UTF-16") == 0
- || strcasecmp(pt->encoding, "UTF-32") == 0))
+ if (SCM_UNLIKELY (c_strcasecmp(pt->encoding, "UTF-16") == 0
+ || c_strcasecmp(pt->encoding, "UTF-32") == 0))
display_character (SCM_UNICODE_BOM, port, iconveh_error);
}