Skip to content

Commit 6a63dea

Browse files
committed
LN_CORE: Allow unicode->utf8string to be applied to longer strings
Note that this increases runtime by about 15 fold, but otherwise it will segfault due to a limit of terms in the apply step with 'Number of arguments exceeds implementation limit'
1 parent f06959c commit 6a63dea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/ln_core/utf8string.scm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
288288
(integer->char (bitwise-ior #x80 (bitwise-and #x3F c)))))
289289
(else (log-error "unicode->utf8string: illegal format")))
290290
))
291-
(else (apply string-append (map unicode->utf8string src)))
291+
(else
292+
(call-with-output-string (lambda (port)
293+
(for-each (lambda (element) (display (unicode->utf8string element) port)) src))))
292294
))
293295

294296
;;u8vectors that need unicode conversion

0 commit comments

Comments
 (0)