Re: UTF8 on Windows 10 using guile 2.27
Richard Shann <[email protected]> Wed, 13 May 2026 17:16:02 +0100
| Newsgroups | gmane.lisp.guile.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2026-05-13 at 14:13 +0000, Mike Gran wrote:
>=20
> > Thank you for your quick response, however:
>=20
> > I don't understand how this can be, the build of Denemo in Debian
>=20
> > (version)
> > -> 2.2.7
>=20
> > and=20
>=20
> > (number->string (string-length "=F0=9D=85=AC"))
>=20
> You're right, and I'm totally wrong about that. It around 2009 that
> unicode started
> to work, so that was 2.0.x not 3.0.x.
>=20
> Maybe you just need to call setlocale to explicitly set a utf-8
> locale?
I did try
(set-port-encoding! (current-input-port) "UTF-8")
(set-port-encoding! (current-output-port) "UTF-8")
(string-length "=F0=9D=85=AC")
but this
but I confess I'm not sure what input port is involved - the part of
Denemo that offers a Guile interpreter interface uses a GTK widget to
input the Scheme text from the user and passes this as the parameter
"script" to this function:
scm_internal_catch (SCM_BOOL_T, (scm_t_catch_body) scm_c_eval_string,=C2=A0
(void *) script,=C2=A0
(scm_t_catch_handler) standard_handler,=C2=A0
(void *) script);
And I see that there is this during initialization of Denemo:
const char prog[] =3D "(catch #t (lambda () (setlocale LC_ALL \"\")) (l=
ambda _(display \"Locale not supported by the C library. Falling back to de=
fault \\\"C\\\" locale.\\n\"(current-error-port))))";
scm_c_eval_string (prog);
results in the message saying it is falling back to the default C locale.
I'm lost!
Richard