[racket] Writing UTF-16 to a socket/file

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Sat Feb 12 21:51:38 EST 2011

On Sat, Feb 12, 2011 at 2:35 PM, Gregory Woodhouse <gregwoodhouse at me.com> wrote:
> Is it possible to ensure that data written to a socket or file is encoded as UTF-16? I ask because Health Level 7 (HL7) 2.5.1 allows messages to use UTF-16 as opposed to US-ASCII, but it has to be a fixed width encoding.

Note that while HL7 may wish it to be fixed width, UTF-16 is a
variable width encoding, with some Unicode codepoints requiring 4
bytes. UCS-2 is a very similar encoding which simply cannot encode the
codepoints requiring 4 bytes in UTF-16, which might be better suited
sam th
samth at ccs.neu.edu

Posted on the users mailing list.