W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: [idl] ByteString

From: Anne van Kesteren <annevk@annevk.nl>
Date: Sun, 24 Jun 2012 08:38:40 +0200
Message-ID: <CADnb78huaSRs_h6GXQyQEZ4UHfce7Vd3jqXhU=++ZuPRU7Zemg@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: public-script-coord@w3.org
On Fri, Jun 22, 2012 at 9:31 AM, Cameron McCormack <cam@mcc.id.au> wrote:
> I forgot about it. :)  I've added it now (in the v2 document):
>
> http://dev.w3.org/2006/webapi/WebIDL/#idl-ByteString
> http://dev.w3.org/2006/webapi/WebIDL/#es-ByteString

Very cool! There's a but, however. The "x modulo 256" trick is not in
line with XMLHttpRequest, which throws for elements greater than 0xFF.
(Although there is one case where it currently does not throw,
getResponseHeader(), I kind of hope implementations are willing to
change that.)


>> I guess a potential downside is that people might misuse it in
>> contexts where it would not be appropriate and where you should use an
>> actual byte representation of sorts instead.
>
> Yes, we probably should have a warning in there.  Can you suggest some
> wording?  I'm struggling to express the cases where you want to use
> ByteString rather than a typed array of 8 bit integers.

"ByteString is only suitable for interfacing with protocols that use
bytes and strings interchangeably, such as HTTP."


-- 
Anne — Opera Software
http://annevankesteren.nl/
http://www.opera.com/
Received on Sunday, 24 June 2012 06:39:09 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC