-3

When I send code in Discord using this:

```py
print("hello world!")
```

it appears in a box with code highlighted as you can see in the picture below. However, when I use Unicode U+055d (Armenian comma) for the code fences (՝՝՝ ՝՝՝) :

՝՝՝py
print("hello world!")
՝՝՝

and send it, the code doesn't get highlighted. It also does not appear in the box as you can see in the picture.

enter image description here

3
  • 4
    For more info, in Unicode these are called "confusables" and there's tons of them. Here's an official demo page. Some others are ˋ`‵`. My favorites are the Cyrillic letters like а and р cause they look exactly like the Latin letters in most fonts.
    – wjandrea
    Oct 11, 2021 at 0:37
  • 8
    Is there any application where Armenian commas do work for formatting code? Why would they?
    – AndreKR
    Oct 11, 2021 at 3:00
  • If you press ALT-96 in windows, you get a backtick, which has an ascii code of 96, or 60 hex; not an armenian comma. Oct 11, 2021 at 6:42

1 Answer 1

16

I faced the same thing when I edited your question. This:

```py
print("hello world!")
```

renders as:

print("hello world!")

whereas this:

՝՝՝py
print("hello world!")
՝՝՝

renders as:

՝՝՝py print("hello world!") ՝՝՝

While the characters for designating code fences are similar to the eye, they are different for your apps. The backtick character (`) has the Unicode representation of U+0060, while the Armenian comma (՝) has the Unicode representation of U+055D, as you said.

The code formatting here and in Discord uses some flavor of Markdown, for which backtick U+0060 characters have a special meaning (are used for highlighting code), while the Armenian comma U+055D character has no special meaning. That makes your text correctly highlighted when using backticks and printed just as you wrote it when using Armenian commas.

2
  • 1
    There is a visible difference between backtick and Armenian comma. Edit: - on this device (PC, chrome, win11). Your mileage may differ.
    – Lenne
    Oct 11, 2021 at 8:48
  • It depends on the font used and the font rendering. When I see this thread from my phone, the difference is clear. However, when I read it from my PC, both look almost the same. Oct 11, 2021 at 8:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .