[pro] CDR for UTF* and UNICODE handling in :element-type (Re: write-char vs. 8-bit bytes)
Bob Cassels
bobcassels at netscape.net
Fri Apr 11 20:18:09 UTC 2014
Because this is a binary write, not a character write. It has nothing to do with Unicode or anything else. Unless the original problem has to do with writing UCS-2 or UTF-16, but there was nothing in the original question that had anything to do with characters, other than the incorrect use of write-char to write a binary value.
On Apr 11, 2014, at 7:37 AM, Antoniotti Marco <antoniotti.marco at disco.unimib.it> wrote:
>
>
> On 2014-04-11, 13:02 , "Pascal J. Bourguignon" <pjb at informatimago.com>
> wrote:
>
>> Antoniotti Marco <antoniotti.marco at disco.unimib.it> writes:
>>
>>> On Apr 10, 2014, at 16:31 , Paul Tarvydas <paultarvydas at gmail.com>
>>> wrote:
>>>
>>>> I'm using sbcl to write-char a 16-bit unsigned integer to a socket as
>>>> two separate unsigned 8-bit bytes, for example 141 should appear as
>>>>
>>>> #x00 #x8d.
>>>>
>>>> SBCL appears to convert the #x8d into a two-byte utf-8 char, resulting
>>>> in 3 bytes written to the stream
>>>>
>>>> \#x00 #xcd #x8d.
>>>>
>>>> What is the proper incantation to achieve this? (SBCL on Windows, if
>>>> that matters).
>>>
>>> It may not be very helpful, but the ³right incantation² would be to
>>> write a CDR that specified the behavior of implementations that deal
>>> with UTF* and UNICODE.
>>
>> No, not in this case.
>
> Why not?
>
> Cheers
> ‹
> MA
>
>
> _______________________________________________
> pro mailing list
> pro at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/pro
More information about the pro
mailing list