Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode feast in time of COVID19 plague #219

Closed
sergeevabc opened this issue Apr 1, 2021 · 12 comments
Closed

Unicode feast in time of COVID19 plague #219

sergeevabc opened this issue Apr 1, 2021 · 12 comments

Comments

@sergeevabc
Copy link

sergeevabc commented Apr 1, 2021

Windows 7, rage 0.5.1

[?] marks are related neither to the chosen console font, nor to the code page (866, 1251, 65001).
0.4.0 was the last one w/o them. Consider figuring out who’s responsible for this freaking decoration.

@str4d
Copy link
Owner

str4d commented Apr 7, 2021

In rage 0.5.0 I added support for translations; as part of that, I extracted these usage info strings so they could be translated. The [?] marks correspond to this section of the strings:

usage-header = Usage:
rage-usage =
{usage-header}
{$usage_a}
{$usage_b}
{$flags}

I think I know how to solve this...

@str4d
Copy link
Owner

str4d commented Apr 7, 2021

Hmm, interesting. I opened #220 thinking that would fix the problem, but it just added missing whitespace. I then noticed that the [?] marks perfectly surround every variable substitution in this multi-line translation string (beyond what OP captured in their screenshot).

@str4d
Copy link
Owner

str4d commented Apr 7, 2021

Yeah, the bug is almost certainly somewhere inside this macro:

i18n_embed_fl::fl!(
LANGUAGE_LOADER,
"rage-usage",
usage_a = usage_a,
usage_b = usage_b,
flags = AgeOptions::usage(),
keygen_name = keygen_name,
example_a = example_a,
example_a_output = example_a_output,
example_b = example_b,
example_c = example_c,
)

which means it's very likely an i18n-embed-fl bug.

@str4d
Copy link
Owner

str4d commented Apr 7, 2021

>>> a = '  ⁨C:'
>>> a.encode()
b'  \xe2\x81\xa8C:'
>>> b = 'OUTPUT.⁩'
>>> b.encode()
b'OUTPUT.\xe2\x81\xa9'

@str4d
Copy link
Owner

str4d commented Apr 7, 2021

Looks like these might be First Strong Isolate and Pop Directional Isolate.

@str4d
Copy link
Owner

str4d commented Apr 11, 2021

Aha, looks like this is kellpossible/cargo-i18n#44, which points me to fluent::bundle::FluentBundle::set_use_isolating:

When formatting patterns, FluentBundle inserts Unicode Directionality Isolation Marks to indicate that the direction of a placeable may differ from the surrounding message.

This is important for cases such as when a right-to-left user name is presented in the left-to-right message.

In some cases, such as testing, the user may want to disable the isolating.

The FSI and PDI marks were introduced in Unicode 6.3.0 in 2013, and Microsoft does appear to use them in its own apps, so IDK why its terminals won't render them correctly by default (i.e. not at all). For now I guess I can just turn them off (which i18n-embed enabled as a fix for the above-linked issue), but I'd prefer to find a solution that works for RTL languages.

@str4d
Copy link
Owner

str4d commented Apr 11, 2021

(in fact, for most of the substitutions we do want these marks to be inserted for RTL languages, since what we are inserting is usually commands that must be LTR).

str4d added a commit that referenced this issue Apr 12, 2021
Unfortunately the common Windows terminals don't support Unicode
Directionality Isolation Marks, rendering them as unknown symbols
instead of invisible markers. We don't have any RTL translations yet, so
we disable the marks for now.

Closes #219. For real this time :)
@str4d
Copy link
Owner

str4d commented Apr 12, 2021

Decided that since we don't have any RTL translations yet, I'll just turn off the marks for now, and we can revisit this either when we add RTL languages, or when Microsoft finally gets modern Unicode support into their default terminals.

@str4d str4d closed this as completed in 0d8aa88 Apr 12, 2021
@sergeevabc
Copy link
Author

@str4d, Rage (or Age for that matter) is far from being an intuitive security solution per se and has all chances to end up like PGP. At first, I would make sure that it is convenient to use the app at least in the English-speaking world, so as not to upset the rest.

@str4d
Copy link
Owner

str4d commented Apr 12, 2021

@sergeevabc I looked at your comment you linked above, and I'm not impressed. Please understand that both this and age are unpaid side projects; as developers we are under no obligation to do anything for anyone.

Suggestions are also far more likely to be considered when conveyed with a positive tone. Take this issue, for instance: the cause of the symbols you were seeing was my conscious and explicit work to make rage a more accessible and user-friendly tool (by adding translations, something few if any Unix tools have). Yet as soon as I solved your issue, instead of any kind of thanks, you point to a comment of yours that belittles the usability efforts we are actively making on age tooling. It really doesn't engender any desire to work on future issues you might open, and frankly discourages me from spending my evenings and weekends on this.

@sergeevabc
Copy link
Author

sergeevabc commented Apr 12, 2021

@str4d, make no mistake, it’s not my issue you solved, it’s your slipshod job I was kind enough to report before the project got buried by the community, which is less tolerant to the modern digital pollution. Developing anything in a spare time is up to you, but when it becomes shared, expect to process various feedback, not exclusively flattery and servile requests, because there is a certain level of expectations set by the achievements of ancestors. It includes bashing, because there are more and more quitters who fuel expectations but fail to deliver. When you state “a simple, modern and secure encryption tool” on the front page, you’re expected to put your money where your mouth is and not to retreat to the bushes with an offended grimace and “no obligation” mumbling once your feathers are stroked the wrong way. To fulfill that promise, the concept of simplicity should be studied properly in the first place — what does average Joe believe is simple based on the experience of using other tools? Translation is hardly the right answer when a user can’t even start using the app because it’s divided in two pieces. Think it over instead of defending your undervalued evenings ego if you really care about lack of tools in particular and society development in general.

@str4d
Copy link
Owner

str4d commented Apr 12, 2021

Congratulations, you've earned yourself a block from me. Have a lovely time "bashing" "quitters".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants