Hi Andy, > From: Andy Wingo <wi...@pobox.com> > But no, currently the answer is locale-specific. It encodes the string > according to the current locale, then decodes it from that encoding. If > your locale can't encode the string, tough luck for you! > > This is a bit crazy. Surely the port should be textual? Surely the > default encoding for a string port should be utf-8 or something that can > actually handle all strings?
Some trivia. The Unicode work began in mainline around Aug 2009. At first, string ports used locale encoding. Then, in Sep 2009, 25ebc0340d30d1ceb786dbc8c3fe80c6e9ae0e87 had them as always using UTF-8 for the reasons that you mention here. There was a discussion as to whether this was the right thing to do that began with the following message https://lists.gnu.org/archive/html/guile-devel/2010-01/msg00012.html The commit 7b0419128bce68f48a158292430ed4a7202aa1b1 set string ports to locale encoding. -Mike