[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 34/58: Add 'scm_to_stringn' shortcut when converting to
From: |
Andy Wingo |
Subject: |
[Guile-commits] 34/58: Add 'scm_to_stringn' shortcut when converting to UTF-8. |
Date: |
Tue, 7 Aug 2018 06:58:35 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 25c719b41294176677f82c511e8e1ca50793b18c
Author: Ludovic Courtès <address@hidden>
Date: Tue Jun 19 14:52:46 2018 +0200
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".
---
libguile/strings.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libguile/strings.c b/libguile/strings.c
index cee64cd..a0a1555 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -2177,6 +2177,12 @@ scm_to_stringn (SCM str, size_t *lenp, const char
*encoding,
if (!scm_is_string (str))
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);
if (ilen == 0)
- [Guile-commits] 16/58: Fix a few typos in the manual., (continued)
- [Guile-commits] 16/58: Fix a few typos in the manual., Andy Wingo, 2018/08/07
- [Guile-commits] 05/58: compile: Load language modules upfront., Andy Wingo, 2018/08/07
- [Guile-commits] 11/58: doc: Fix typo about SRFI-4 syntax., Andy Wingo, 2018/08/07
- [Guile-commits] 09/58: 'select' returns empty sets upon EINTR and EAGAIN., Andy Wingo, 2018/08/07
- [Guile-commits] 14/58: Recognize RISC-V compilation targets., Andy Wingo, 2018/08/07
- [Guile-commits] 21/58: goops: Fix 'instance?' to work on objects that aren't structs., Andy Wingo, 2018/08/07
- [Guile-commits] 10/58: build: Use 'sed' invocation compatible with BSD sed., Andy Wingo, 2018/08/07
- [Guile-commits] 24/58: Add copyright header for (language elisp falias), and fix typo., Andy Wingo, 2018/08/07
- [Guile-commits] 29/58: get-bytevector-n and get-bytevector-n! can now read more than 4 GB, Andy Wingo, 2018/08/07
- [Guile-commits] 26/58: tests: Add SRFI-71 test., Andy Wingo, 2018/08/07
- [Guile-commits] 34/58: Add 'scm_to_stringn' shortcut when converting to UTF-8.,
Andy Wingo <=
- [Guile-commits] 12/58: srfi-18: When timeout is a number, it's a relative number of seconds., Andy Wingo, 2018/08/07
- [Guile-commits] 22/58: Fix error reporting in 'load-thunk-from-memory'., Andy Wingo, 2018/08/07
- [Guile-commits] 19/58: Fix type inference for bitwise logical operators., Andy Wingo, 2018/08/07
- [Guile-commits] 23/58: elisp: Fix cross-compilation support., Andy Wingo, 2018/08/07
- [Guile-commits] 33/58: Module import obarrays are accessed in a critical section., Andy Wingo, 2018/08/07
- [Guile-commits] 38/58: GDB support: Fix 'display-vm-frames'., Andy Wingo, 2018/08/07
- [Guile-commits] 41/58: linker: Don't rely on out-of-range bv-ref exceptions., Andy Wingo, 2018/08/07
- [Guile-commits] 40/58: GDB support: Add 'guile-backtrace' command., Andy Wingo, 2018/08/07
- [Guile-commits] 27/58: Make module autoloading thread-safe., Andy Wingo, 2018/08/07
- [Guile-commits] 51/58: compile: Improve error message., Andy Wingo, 2018/08/07