Subject: bug#21221: closed (Re: bug#21221: guile-2.2 socket ports used with display does not send utf8 !)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 20 Jun 2016 15:56:02 +0000

Your bug report

#21221: guile-2.2 socket ports used with display does not send utf8 !

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21221: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21221
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21221: guile-2.2 socket ports used with display does not send utf8 !
From: Andy Wingo <[email-masked]>
To: Linas Vepstas <[email-masked]>
Cc: [email-masked]
Date: Mon, 20 Jun 2016 17:55:37 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sun 09 Aug 2015 04:20, Linas Vepstas <[email-masked]> writes:

> The following simple client-server program fails for me.
> For simplicity, for the server, just use netcat listening on port 7777:
>
> $ nc -l 7777
>
> In a guile shell, try this:
> (setlocale LC_ALL "")
> (define sss (socket PF_INET SOCK_STREAM 0))
> (set-port-encoding! sss "utf-8")
> (connect sss AF_INET (inet-pton AF_INET "127.0.0.1") 7777)
> (set-port-encoding! sss "utf-8")
> (display "SmålandSmåland\n" sss)
> (close-port sss)
>
>
> The SmålandSmåland gets corrupted:  nc receives Sm?landSm?land

I have tried this in 2.1.3 and it seems to work for me.  Thanks for the
report, please reopen if you can still reproduce the bug.

Cheers,

Andy

Subject: guile-2.2 socket ports used with display does not send utf8 !
From: Linas Vepstas <[email-masked]>
To: [email-masked]
Date: Sat, 8 Aug 2015 21:20:54 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

The following simple client-server program fails for me.
For simplicity, for the server, just use netcat listening on port 7777:

$ nc -l 7777

In a guile shell, try this:
(setlocale LC_ALL "")
(define sss (socket PF_INET SOCK_STREAM 0))
(set-port-encoding! sss "utf-8")
(connect sss AF_INET (inet-pton AF_INET "127.0.0.1") 7777)
(set-port-encoding! sss "utf-8")
(display "SmålandSmåland\n" sss)
(close-port sss)

The SmålandSmåland gets corrupted:  nc receives Sm?landSm?land

Some types of utf8 do go through, so e.g. (display "Ćićolina\n" sss)
seems to work fine.  This finish/norweign thing, though, fails,
vietnamese too.
(display "Hòa Phú Phú Tân Hiệp An  Tương Bình Hiệp Định Hòa\n" sss)

I suppose the answer is "don't use display for sending strings on a
socket", but I'm stumped as to why there should even be an encoding
error, why its not utf8 end-to-end.

This is for guile-2.2 from a recent git pull of the master source from
about June 2015, but I believe the problem occurs on guile-2.0 as
well.

guile --version
guile (GNU Guile) 2.1.0.305-e7097-dirty

this is on ubuntu 14.04 aka ubuntu trusty

-- Linas Vepstas