Re: [rtcweb] PPID, UTF-16 and DOMString (Re: RTCWEB Data Channel: Usage of PPID for protocol multiplexing)

Randell Jesup <randell-ietf@jesup.org> Sat, 08 February 2014 20:24 UTC

Return-Path: <randell-ietf@jesup.org>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 542FF1A055F for <rtcweb@ietfa.amsl.com>; Sat, 8 Feb 2014 12:24:10 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.4
X-Spam-Level: *
X-Spam-Status: No, score=1.4 tagged_above=-999 required=5 tests=[BAYES_50=0.8, J_CHICKENPOX_47=0.6, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kj0kA1v2RNri for <rtcweb@ietfa.amsl.com>; Sat, 8 Feb 2014 12:24:09 -0800 (PST)
Received: from r2-chicago.webserversystems.com (r2-chicago.webserversystems.com [173.236.101.58]) by ietfa.amsl.com (Postfix) with ESMTP id DF4161A05D7 for <rtcweb@ietf.org>; Sat, 8 Feb 2014 12:24:07 -0800 (PST)
Received: from [12.131.214.70] (port=60273 helo=[10.0.0.14]) by r2-chicago.webserversystems.com with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from <randell-ietf@jesup.org>) id 1WCERc-000GLo-0N for rtcweb@ietf.org; Sat, 08 Feb 2014 14:24:08 -0600
Message-ID: <52F69278.4000401@jesup.org>
Date: Sat, 08 Feb 2014 12:24:24 -0800
From: Randell Jesup <randell-ietf@jesup.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Thunderbird/27.0
MIME-Version: 1.0
To: rtcweb@ietf.org
References: <7594FB04B1934943A5C02806D1A2204B1D15E955@ESESSMB209.ericsson.se> <74072016-DA11-41E8-9944-779428163EE4@lurchi.franken.de> <7594FB04B1934943A5C02806D1A2204B1D15ED94@ESESSMB209.ericsson.se> <E1FE4C082A89A246A11D7F32A95A17826DFCF6C8@US70UWXCHMBA02.zam.alcatel-lucent.com> <B304F67A-9EA2-44A0-86DD-9DD0E21CB86F@lurchi.franken.de> <52F4182F.60404@alvestrand.no> <E1FE4C082A89A246A11D7F32A95A17826DFD40C3@US70UWXCHMBA02.zam.alcatel-lucent.com> <CABkgnnXMYt7teSpxm7chTvQPR8ThKzKQ_bq3Po_FNFv2tdBFGQ@mail.gmail.com>
In-Reply-To: <CABkgnnXMYt7teSpxm7chTvQPR8ThKzKQ_bq3Po_FNFv2tdBFGQ@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - r2-chicago.webserversystems.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - jesup.org
X-Get-Message-Sender-Via: r2-chicago.webserversystems.com: authenticated_id: randell@jesup.org
Subject: Re: [rtcweb] PPID, UTF-16 and DOMString (Re: RTCWEB Data Channel: Usage of PPID for protocol multiplexing)
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtcweb/>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Feb 2014 20:24:10 -0000

On 2/7/2014 6:45 PM, Martin Thomson wrote:
> I don't think that we need any complication here.  It's a string.
>
> Strings are UTF-8 on the wire.
>
> Strings are UTF-16 (mostly) in JavaScript.
>
> Anything else would generate pain.

(Back online while traveling; been off mostly due to extended power 
outage in Philadelphia suburbs)

100% agree.  And currently that's what we do in Firefox at the 
JS->protocol interface:

void
nsDOMDataChannel::Send(const nsAString& aData, ErrorResult& aRv)
{
   NS_ConvertUTF16toUTF8 msgString(aData);
   Send(nullptr, msgString, msgString.Length(), false, aRv);
}

The JS interface matches WebSockets Send().  The wireline interface is 
(and should be) UTF8; any registrations should be updated to make this 
clear.

-- 
Randell Jesup
randell-ietf@jesup.org