unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* string-ports issue on Windows
@ 2019-04-16  4:13 Christopher Lam
  2019-04-16 14:34 ` Eli Zaretskii
  2019-04-16 17:28 ` Mark H Weaver
  0 siblings, 2 replies; 14+ messages in thread
From: Christopher Lam @ 2019-04-16  4:13 UTC (permalink / raw)
  To: guile-user

Dear All

I'm struggling with string-ports on Windows.

Last para of
https://www.gnu.org/software/guile/manual/html_node/String-Ports.html
"With string ports, the port-encoding is treated differently than other
types of ports. When string ports are created, they do not inherit a
character encoding from the current locale. They are given a default locale
that allows them to handle all valid string characters."

This causes a string-sanitize function to not run correctly in Windows.
(locale-encoding) says "CP1252" no matter what LANG or setlocale I try.

The use case is to sanitize string for html, but on Windows it munges
extended-unicode. So i've had to resort to this uglier code:
https://pastebin.com/raw/ys4QrhMh which does work, but raises the question
why we have to do it in the first place.

It means *any* string-ports must be avoided to avoid cross-platform string
issues, right? It's a shame because (format) is quite useful.

Chris


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-05-26 20:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16  4:13 string-ports issue on Windows Christopher Lam
2019-04-16 14:34 ` Eli Zaretskii
2019-04-16 17:15   ` Mark H Weaver
2019-04-16 17:28 ` Mark H Weaver
2019-04-16 23:26   ` Christopher Lam
2019-04-17 19:30     ` Mark H Weaver
2019-04-18 16:22       ` Christopher Lam
2019-04-18 18:51         ` Eli Zaretskii
2019-04-18 19:29         ` Mark H Weaver
2019-04-18 21:18           ` Mark H Weaver
2019-04-19 10:26             ` Christopher Lam
2019-05-14  4:42               ` Christopher Lam
2019-05-26 10:52                 ` Christopher Lam
2019-05-26 20:48                   ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).