r/programming • • Nov 10 '21

The Invisible JavaScript Backdoor

https://certitude.consulting/blog/en/invisible-backdoor/
1.4k Upvotes

295 comments sorted by

View all comments

Show parent comments

-83

u/PL_Design Nov 10 '21 edited Nov 10 '21

Banning unicode is not silly. Unicode is dreadful, and most programs will never be translated. 99% of the time it is literally pointless and people would be better served by using local character encodings.

EDIT: Isn't it interesting how saying you dislike unicode causes everyone to dogpile you? It feels like all of you have been brainwashed. It is startlingly creepy. I suggest you freaks go to therapy.

51

u/CartmansEvilTwin Nov 10 '21

No. We had that already with all those ISO encodings and it's hell.

What is the local encoding for Germany for example? We have our own Umlaut-characters, but what if some spaniard called Piñera wants to live here? And what about André, Çem, etc.?

So you end up with an encoding that looks almost identical to Unicode/UTF-8 anyway.

7

u/naasking Nov 11 '21

What is the local encoding for Germany for example? We have our own Umlaut-characters, but what if some spaniard called Piñera wants to live here? And what about André, Çem, etc.?

There's a middle ground here: only permit full Unicode between a programming language's string delimiters, ie. typically between two " characters, and the rest of the grammar must use only printable ASCII characters. This takes care of all input/output issues like the example you mention, without introducing homoglyph and invisible character vulnerabilities into a language's grammar.

9

u/auxiliary-character Nov 11 '21

This takes care of all input/output issues like the example you mention

Except for when you want to credit a programmer named Piñera in a comment, since comments exist outside string delimiters.

1

u/marinuso Nov 11 '21

Code isn't the same as data. You can have Mr. Piñera living on the Einbahnstraße but you name the columns lastname and street. (In English, because code should be written in English anyway.)

It's perfectly sane to restrict identifiers to ASCII, or preferably even a subset of that. Even APL of all languages restricts identifiers to letters, numbers, and a handful of whitelisted punctuation characters.

(Of course you shouldn't ban Unicode entirely.)

→ More replies (33)

30

u/mindbleach Nov 10 '21

In which the programming subreddit tries to solve the underhanded C competition by saying a compiler should shit the bed if you add Tools > Preferences > Language > 日本語.

And if I try to copy-paste code from a StackOverflow user in Russia, I guess I can go fuck myself.

-18

u/PL_Design Nov 10 '21

Technology Connections would call these "but sometimes" arguments. Pass.

36

u/mindbleach Nov 10 '21

The existence of other languages is not a sometimes problem.

If your code fails because someone tried to write one letter - your code sucks.

If your review process can't handle the author's name if they're not hwhite - your process sucks.

-12

u/PL_Design Nov 10 '21

99% of programs do not need to do these things, and it is trivial to make 7-bit ASCII let UTF-8 characters pass through harmlessly. As an English speaker that satisfies me. Other peoples can resolve the problem for themselves.

The 1% of software that actually needs something like unicode obviously should use it, but nothing else.

27

u/mindbleach Nov 10 '21

Public response to your assertion suggests those numbers were sourced from the vicinity of your pelvis.

→ More replies (3)

14

u/wankthisway Nov 11 '21

As an English speaker that satisfies me. Other peoples can resolve the problem for themselves

Jesus this is a self-centered fucking view.

0

u/PL_Design Nov 11 '21

Sounds like you have a savior complex. You do realize people who live in other countries are capable of fending for themselves, right?

13

u/Sag0Sag0 Nov 11 '21

You do realise that international standards should not be designed solely for English speakers?

0

u/PL_Design Nov 11 '21

And when you need unicode you should use it. Protip: You ain't gonna need it.

→ More replies (6)

21

u/ClassicPart Nov 10 '21

99% of the time it is literally pointless

Sit down for this one, but it might shock you to learn that there are other countries on this planet. It's "literally pointless" for you. Get it right.

-4

u/PL_Design Nov 11 '21

I did get it right. They can use their own encodings optimized for their uses.

13

u/DethRaid Nov 11 '21

Isn't it interesting that you have a bad idea and everyone is downvoting that because it's a bad idea?

→ More replies (5)

7

u/scratchisthebest Nov 11 '21

i agree also everyone on the planet should speak english. i am very smart. i love to use "code pages"

1

u/PL_Design Nov 11 '21

It would be convenient, wouldn't it? But that's not what I was suggesting.

3

u/wankthisway Nov 11 '21

saying you dislike unicode

is not the same as you actually saying

Unicode is dreadful,

Less victim mentality, please.

1

u/PL_Design Nov 11 '21

I'll call a piece of shit a piece of shit, thank you very much.

1

u/Sag0Sag0 Nov 11 '21

Yes, you are right. This is just one big conspiracy by big Unicode.

1

u/PL_Design Nov 11 '21

I'm sooo glad you get it.

2

u/Sag0Sag0 Nov 11 '21

I am too! Thank you for showing me the light.

1

u/PL_Design Nov 11 '21

You are welcome, my child. Always remember, when doubt seeps into your heart: One byte per character, as God intended.

→ More replies (4)