Re: [Ltru] [apps-discuss] Defining a CBOR tag for RFC 5646Language Tags

"Peter Occil" <> Mon, 19 May 2014 22:35 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 202621A0413; Mon, 19 May 2014 15:35:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.588
X-Spam-Status: No, score=0.588 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, SPF_PASS=-0.001, STOX_REPLY_TYPE=0.439] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Hpn_f1eSWxjj; Mon, 19 May 2014 15:35:13 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:400d:c04::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 937761A038B; Mon, 19 May 2014 15:35:13 -0700 (PDT)
Received: by with SMTP id q108so9846703qgd.33 for <multiple recipients>; Mon, 19 May 2014 15:35:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=message-id:from:to:references:in-reply-to:subject:date:mime-version :content-type:content-transfer-encoding:importance; bh=I1dJiZJQZGk4MlefvEoOG4+ge/Olxk1hOgbyAkUznxM=; b=xoBzU2n0oC2zApSIO4mf0h6uQKA0oMB6bdDvt2DjjxAhifUhzUvXxKhHNBMToZGO+z CudAw6QP+MbpUITG6F9p8kRL02fgW0oLZc+hgw21d82o724CSxvSf1Gz/JIt7xHebkE0 GHBB6TOBEazCGxrfst8CBJSYGWJF+0XNxzAA8o1awfDQIIHnW2YeKfzHSlEkthVtG5Al LkI9Fnv+UUsz63VlrH9aYHGJ7wf1o1EPJgwRbEbW8sTGBmDDl3ODcvdtb9PEPCmFFc+E Lshod0+3hT9hr4VxM6gDICqRuE1N5NDQNkMtP+8Z99IbO7N2FpWN0UFRiG7hS1ECEnMO ag9A==
X-Received: by with SMTP id t19mr52510487qag.42.1400538912891; Mon, 19 May 2014 15:35:12 -0700 (PDT)
Received: from PeterPC ( []) by with ESMTPSA id w4sm19886151qat.5.2014. for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 15:35:12 -0700 (PDT)
Message-ID: <2C9B140A7DFC42BEAE99AAA458EC9354@PeterPC>
From: Peter Occil <>
To: "Joe Hildebrand (jhildebr)" <>, LTRU Working Group <>,
References: <> <9BE5D3F7FAEE4CAB8FD3326ED8F1ED75@PeterPC> <> <> <92A56D2F207E4A9893AEDBC13336FA28@PeterPC> <15955C4E122344DDBBAA53E803A8F08E@PeterPC> <>
In-Reply-To: <>
Date: Mon, 19 May 2014 18:35:06 -0400
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="UTF-8"; reply-type="original"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 16.4.3528.331
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331
X-Antivirus: avast! (VPS 140519-1, 05/19/2014), Outbound message
X-Antivirus-Status: Clean
Subject: Re: [Ltru] [apps-discuss] Defining a CBOR tag for RFC 5646Language Tags
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Language Tag Registry Update working group discussion list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 19 May 2014 22:35:16 -0000

As I recall, that is similar to the approach taken by JSON-LD when mapping 
the same text in different languages (there it's called a "language map").

However, one problem that I see is that this requires case-insensitive 
comparison of
keys: if a decoder encounters a language map with two keys that differ only 
in case (for example, "en" and "EN"), which one should it use?  The one 
defined earlier or later?  While there are already CBOR tags in the registry 
that depend on such ordering (such as string references and shared 
references), I believe that defining further tags that depend on this kind 
of ordering of values in the CBOR stream should be avoided as much as 
possible.  Another approach may be to forbid such an ambiguous language map 
or ignore ambiguous keys, but I don't know which is the best approach.

Issues like those should be dealt with in another tag proposal; I don't mind 
if tag 38 (this proposal) is changed to use language maps, but additional 
discussion would have to be necessary.  Until then, the simple 
language-tagged string is enough.


-----Original Message----- 
From: Joe Hildebrand (jhildebr)
Sent: Monday, May 19, 2014 3:25 PM
To: Peter Occil ; LTRU Working Group ;
Subject: Re: [apps-discuss] [Ltru] Defining a CBOR tag for RFC 5646Language 

Hm.  I was thinking:

{ "en": "Hello", "fr": "Bonjour" }

for the case of alternatives.  The wire size between

[ "en": "Hello" ] and { "en": "Hello" }

is zero; perhaps we could kill two birds with one stone?

On 5/15/14, 10:35 AM, "Peter Occil" <> wrote:

>I have updated my specification on language-tagged strings.
>The two things new are:
>- The "NOTE" section.
>- The sentence "Both the language tag and the arbitrary string can
>optionally be annotated with CBOR tags."
>apps-discuss mailing list

Joe Hildebrand