Subject: [precis] PRECIS bidi rule for usernames

From: William Fisher <[email-masked]>
Date: Fri, 7 Oct 2016 12:00:31 -0700

I've been working on a python implementation of the PRECIS specification
(https:github.com/byllyfish/precis-i18n).

The Username profiles apply the "bidi rule".

       Directionality Rule: Applications MUST 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).

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.

If the answer is A, then "Juliet+" is a valid username.

If the answer is B, "Juliet+" is not a valid username because it violates
the Bidi rule.

I think the answer is probably A. However, this implies that right-to-left
usernames can never begin or end with ASCII punctuation.

Thanks,
Bill

---

From: Sam Whited <[email-masked]>
Date: Fri, 7 Oct 2016 14:28:55 -0500

> (https:github.com/byllyfish/precis-i18n).

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.

> 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

-- 
Sam Whited
pub 4096R/54083AE104EA7AD3

---

From: Peter Saint-Andre <[email-masked]>
Date: Sun, 9 Oct 2016 21:12:52 -0600

On 10/7/16 1:28 PM, Sam Whited wrote:
> with punctuation, but strings with them could.

There are plenty of RTL punctuation characters (e.g., U+05BE), and those 
are allowed in RTL strings (even as the last character). RFC 5893 says 
that an RTL string must not have an LTR character at the end, with the 
result that an RTL string cannot end in "."; this helps to prevent 
confusion in the typical presentation of domain names (which is the 
target use case for RFC 5893).

> This violates the

It's perhaps not advisable for you and I to speculate about what might 
surprise a user whose native language is represented in a right-to-left 
script.

Peter

---

From: Sam Whited <[email-masked]>
Date: Sun, 9 Oct 2016 23:26:41 -0500

On Sun, Oct 9, 2016 at 10:12 PM, Peter Saint-Andre <[email-masked]> wrote:
> There are plenty of RTL punctuation characters (e.g., U+05BE), and those are
> allowed in RTL strings (even as the last character). RFC 5893 says that an
> RTL string must not have an LTR character at the end, with the result that
> an RTL string cannot end in "."; this helps to prevent confusion in the
> typical presentation of domain names (which is the target use case for RFC
> 5893).

That makes sense; thanks for the clarification.

—Sam