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

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Sat Feb 12 15:43:07 EST 2011

You can use string->utf16 from rnrs/bytevectors-6:

(require rnrs/bytevectors-6)

(string->utf16 "abc")

and them use "write-bytes".


On 2/12/2011 2:35 PM, Gregory Woodhouse 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.
> _________________________________________________
>    For list-related administrative tasks:
>    http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.