From: john@peppermind.com
Subject: A few questions on parsing, sockets, UTF-8 strings
Date: Thu, 11 Aug 2016 07:39:12 -0700 (PDT)
Date: 2016-08-11T07:39:12-07:00 [thread overview]
Message-ID: <267bd80f-b388-4df6-b712-315ee9bda2b8@googlegroups.com> (raw)
Hi! For some non-standard interprocess communication, I need to:
1. Listen with a TCP socket to the local loopback interface and obtain the PORT suggested by the OS, i.e. like with bind() to port 0 and getsockname() in C. Is this possible with GNAT.sockets?
2. Connect to the incoming host and parse input and send output delimited by LF line-by-line. What about buffering, can it be switched off or is there a line buffer mode already? (It needs to be compatible with LF instead of CR+LF as delimiter, though.)
3. Convert back and forth between Base64-encoded UTF-8 strings and UTF-8 strings (which may also be represented in the source text). How do I do this?
Especially the last point is a bit mysterious to me. I cannot use UCS-2, it needs to be full UTF-8. Should I use a library for UTF-8 strings? Which one?
Speed is not very important, but I'd like to avoid unnecessary conversions.
next reply other threads:[~2016-08-11 14:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-11 14:39 john [this message]
2016-08-11 16:23 ` A few questions on parsing, sockets, UTF-8 strings Dmitry A. Kazakov
2016-08-11 17:40 ` john
2016-08-11 17:49 ` Dmitry A. Kazakov
2016-08-11 18:22 ` john
2016-08-11 19:09 ` gautier_niouzes
2016-08-11 21:10 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox