mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
Add 'scm_to_stringn' shortcut when converting to UTF-8.
* libguile/strings.c (scm_to_stringn): Call 'scm_to_utf8_stringn' when ENCODING == "UTF-8".
This commit is contained in:
parent
edc80bd595
commit
25c719b412
1 changed files with 6 additions and 0 deletions
|
@ -2177,6 +2177,12 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding,
|
||||||
|
|
||||||
if (!scm_is_string (str))
|
if (!scm_is_string (str))
|
||||||
scm_wrong_type_arg_msg (NULL, 0, str, "string");
|
scm_wrong_type_arg_msg (NULL, 0, str, "string");
|
||||||
|
|
||||||
|
if (c_strcasecmp (encoding, "UTF-8") == 0)
|
||||||
|
/* This is the most common case--e.g., when calling libc bindings
|
||||||
|
while using a UTF-8 locale. */
|
||||||
|
return scm_to_utf8_stringn (str, lenp);
|
||||||
|
|
||||||
ilen = scm_i_string_length (str);
|
ilen = scm_i_string_length (str);
|
||||||
|
|
||||||
if (ilen == 0)
|
if (ilen == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue