Re: [precis] PRECIS bidi rule for usernames

Sam Whited <> Fri, 07 October 2016 19:29 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 9DA461295FE for <>; Fri, 7 Oct 2016 12:29:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.701
X-Spam-Status: No, score=-2.701 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id H3MF_WaUyBLS for <>; Fri, 7 Oct 2016 12:29:37 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:400d:c0d::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 07A60129530 for <>; Fri, 7 Oct 2016 12:29:37 -0700 (PDT)
Received: by with SMTP id f6so25714482qtd.2 for <>; Fri, 07 Oct 2016 12:29:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=swgoo; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TqYYOeJgTyfVrHQpmzx4e0PUxioJc0tC1ETUo69Cq4s=; b=H7cqO6boae47Hr5uAOQuwph2dC/UjeNEuA+UsGQpIr7OJPcw7g86BeZkAXqYmFDNbc zGu0KP9ZwZzw1sokblGkj6/glLc7mpcTFO0d2Ce1KCAzIcDIjx0r4i3vASBk+m8Ah2C7 BraCvQSD6AwAGEwOuEPIBRbbnBoBNJ5VdSxcg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TqYYOeJgTyfVrHQpmzx4e0PUxioJc0tC1ETUo69Cq4s=; b=FV+0JeZUJlbSsNuxr5XJyWbw1/BhG9z470tHSvqS7NPEz4GCAG5OGhzYJ0kkXiMvPE fWQNOXCaH44Yf8pIsVlg3PEt4JOoLcJhre31TTCWNC6sV0vTpiTjVGqCC4R9XDJPX3I4 CgDXfrSwhcM7mHK5EQyZjAjo0L8ce8zVgVT0tKVrf/ChKLX1VFuwS6cL5DuWwtMfbKL4 5ZWN6G+f+6CW46vnD7R1phJBQcSYlRDXPnhY9q5WZeV5oNtnIdTqr0LapzbDlJvFEOV5 9v61La0S4bdMviTFqb0rSCksWm4tO84chfkccQxYRxVjJb4E7QBfOh1LGbX8/ON5iS7L wXfQ==
X-Gm-Message-State: AA6/9Rnpi5mE3+8vtfGK5zJ6zhqMOBDwjLb8UsQMTovNtV46DgShh96t70Tk9oGY0Q/dyhArgTA8HBAowYCkVA==
X-Received: by with SMTP id e46mr21550264qte.95.1475868576023; Fri, 07 Oct 2016 12:29:36 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Fri, 7 Oct 2016 12:28:55 -0700 (PDT)
X-Originating-IP: []
In-Reply-To: <>
References: <>
From: Sam Whited <>
Date: Fri, 7 Oct 2016 14:28:55 -0500
Message-ID: <>
To: William Fisher <>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Archived-At: <>
Subject: Re: [precis] PRECIS bidi rule for usernames
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Preparation and Comparison of Internationalized Strings <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 07 Oct 2016 19:29:39 -0000

On Fri, Oct 7, 2016 at 2:00 PM, William Fisher
<> wrote:
> I've been working on a python implementation of the PRECIS specification
> (

Great timing; I was just this moment looking at your library and
considering including it in some interoperability tests for a set of
test vectors I'm working on.

> Can someone please clarify whether:
> A. The "Bidi rule" is ONLY applied to strings that contain right-to-left
> characters.
> B. The "Bidi rule" is applied to ALL strings.

The recent draft-ietf-precis-7613bis-03 clarifies this:

       Directionality Rule: Apply the "Bidi Rule" defined in [RFC5893]
       to strings that contain right-to-left characters (i.e., each of
       the six conditions of the Bidi Rule must be satisfied); for
       strings that do not contain right-to-left characters, there is no
       special processing for directionality.

I was apparently confused about this before too, I'm applying Bidi all
the time in the Go implementation. I'll be sure to add a test for this
in the test vectors when I publish them.

I'm actually not convinced this is the correct behavior though; it
seems confusing to me that usernames with RTL characters couldn't end
with punctuation, but strings with them could. This violates the
principal of least suprise.

Maybe Peter (CCed) can clarify if I'm misunderstanding something?


Sam Whited
pub 4096R/54083AE104EA7AD3