[Development] Prettier printing of Unicode strings

Knoll Lars Lars.Knoll at digia.com
Mon Jan 27 09:06:58 CET 2014



On 27/01/14 00:03, "Thiago Macieira" <thiago.macieira at intel.com> wrote:

>On domingo, 26 de janeiro de 2014 20:17:20, Knoll Lars wrote:
>> I usually prefer the output in utf8, as it gives readable strings (at
>> least on Mac and Linux as long as you don¹t mess with the locale).
>>Escaped
>> strings are much more tedious to debug for me in most cases. So I¹d like
>> to ask for at least an option to get utf8 strings as output, and only
>> escape non printable chars.
>
>The problem is that Unicode can trick your eyes:
>
>Actual   (s1): Thiago José Macieira / Lars Knoll
>Expected (s2): Thiago José Macieira ∕ Lаrs Knoll
>
>Can you tell the difference with your eyes? There's a reason that IDNA
>requires 
>lengthy transformations in the NamePrep stage and requires registrars to
>apply 
>anti-homographic rules.
>
>With my change as it is, you'd see:
>Actual   (s1): Thiago Jos\u00E9 Macieira / Lars Knoll
>Expected (s2): Thiago Jose\u0301 Macieira \u2215 L\u0430rs Knoll

I know that, but we’re usually not writing our auto tests to try and
trick someone. Just saying that for many use cases utf8 output makes the
issue easier to spot. How about an environment variable to turn off
escaping?

Cheers,
Lars



More information about the Development mailing list