# Unicode: a bad idea, in general

**URL:** <https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897>\
**Category:** General Usage\
**Created:** [June 5, 2023, 3:25pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897 "2023-06-05T15:25:07Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)\
**Post date:** [June 6, 2023, 7:29pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/41 "2023-06-06T19:29:36Z")

</div>

Would love to see the Python version! 😂

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [June 6, 2023, 7:38pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/42 "2023-06-06T19:38:50Z")

</div>

I would love Unicode package names:

```julia
using 🍌, 🍳, 🍴

```

And of course we let slip through our fingers the emoticon for the file name extensions.

---

<div class="post-metadata">

**Author:** ![frylock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/frylock/32/50213_2.png) [@frylock](https://discourse.julialang.org/u/frylock)\
**Post date:** [June 6, 2023, 7:57pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/43 "2023-06-06T19:57:27Z")

</div>

Julia could also be the first to adopt an emoji for the default file extension:  
MyCoolApp.🌩

Edit: heh, should have read the post above mine

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [June 6, 2023, 8:07pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/44 "2023-06-06T20:07:00Z")

</div>

Too late: [Modular Docs - Mojo🔥 FAQ](https://docs.modular.com/mojo/faq.html#why-does-mojo-have-the-file-extension)

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [June 6, 2023, 8:30pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/45 "2023-06-06T20:30:31Z")

</div>

> [@moble](#):
>
> I hesitate to add my two cents, for all the derision I’m sure to attract for going overboard,

Hopefully no derision at all, because I 100% agree with using the capabilities of unicode to the fullest extent possible. In fact, it’s one of the things that attracted me to Julia in the first place. I appreciate that @PetrKryslUCSD will never agree with that, but luckily we don’t work on the same code bases 😉

Your idea of allowing both ascii and unicode keyword arguments is amazing, and I’m very likely to adopt that approach. Thanks!

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [June 6, 2023, 8:34pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/46 "2023-06-06T20:34:51Z")

</div>

For those on a Mac wanting to type scientific unicode a lot: [The "U.S. International - Scientific" Keyboard Layout - Michael Goerz](https://michaelgoerz.net/notes/the-us-international-scientific-keyboard-layout/index.html)

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [June 6, 2023, 8:49pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/47 "2023-06-06T20:49:46Z")

</div>

A careful (conservative) use of unicode can make the code much easier to understand, while still being clear. My rules are: simple unicode that (1) most programmer’s fonts (Consolas, say) can render; (2) not easily mixed up with other similarly looking symbols.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [June 6, 2023, 9:47pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/48 "2023-06-06T21:47:38Z")

</div>

> [@moble](#):
>
> I hesitate to add my two cents, for all the derision I’m sure to attract for going overboard, but personally I come down _very_ strongly on the side of using UTF-8 in my own code, while ensuring that the API _allows_ people to use either UTF-8 or ASCII.

You shouldn’t hesitate. I think your opinion is the majority opinion here. Unicode is good, but there should be non-unicode API options available, and your method of defining both ASCII and unicode kwargs simultaneously is clever and worth sharing.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 6, 2023, 10:02pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/49 "2023-06-06T22:02:53Z")

</div>

Well, avoiding Unicode in API (or at least giving an option not to use it) is good. But (as someone pointed out already), code is read more often than it is written. So we should try to make the graphical presentation of the _internal_ code (i.e. not API) as easy on the reader as possible. The ability of readers to affect the graphical presentation of Unicode is typically limited (viz Github), and hence use of problematic symbols should be prohibited, and use of other symbols should be considered from the point of view of visual confusion (viz \rho vs _p_ vs `rho` etc.).

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [June 6, 2023, 10:06pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/50 "2023-06-06T22:06:17Z")

</div>

> [@PetrKryslUCSD](#):
>
> problematic symbols

I assume that’s not every non-ascii symbol? Do you know which ones are particularly problematic?

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [June 6, 2023, 10:14pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/51 "2023-06-06T22:14:17Z")

</div>

> [@PetrKryslUCSD](#):
>
> But (as someone pointed out already), code is read more often than it is written.

Agreed! So it should be made readable by using whatever notation and conventions are approriate for the problem at hand.

If I am writing code which implements some physics concept, and I expect my code to be read by fellow physicists who have similar training to me, then the most appropriate notation and conventions to clearly communicate ideas are typically going to involve a lot of unicode and single letter variables.

If I’m writing code that I intended to be read and used by a wide variety of people with a wide variety of backgrounds, then the choices as to what maximizes comprehension may look very different (or maybe they just involve better documentation).

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 6, 2023, 10:17pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/52 "2023-06-06T22:17:14Z")

</div>

> **[Commonly Confused Characters](https://www2.cs.sfu.ca/~ggbaker/reference/characters/#single)**
>
> A discussion of characters that are commonly confused in typography.

[https://util.unicode.org/UnicodeJsps/confusables.jsp](https://util.unicode.org/UnicodeJsps/confusables.jsp)

> **[How special characters affect screen readers - Scope for Business](https://business.scope.org.uk/article/accessibility-screen-readers-special-characters-and-unicode-symbols)**
>
> Learn how special characters, Unicode symbols, punctuation, emoticons and ASCII art impact screen reader accessibility and AT users.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/5/15009a704607fcf7ca14f78177ba2399b10c2a6a.png)

[https://websec.github.io/unicode-security-guide/visual-spoofing/](https://websec.github.io/unicode-security-guide/visual-spoofing/)  
[http://www.unicode.org/Public/security/latest/confusables.txt](http://www.unicode.org/Public/security/latest/confusables.txt)  
How is this for a start?

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [June 6, 2023, 10:52pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/53 "2023-06-06T22:52:12Z")

</div>

> [@PetrKryslUCSD](#):
>
> How is this for a start?

For a _start_? It’s a bit much, actually. Is there some way to extract the essence? I also see ‘ascii confusables’ in there. What sort of characters is it that you would like to prohibit which are allowed today?

Also, isn’t there some sort of normalization of similar unicode symbols happening already?

As for the list of groups affected by reading problems, at least “people with limited time or attention span” and “non-native English speakers”, should benefit from short and visually distinct symbols over long descriptive names.

Maximizing readability for people without reading problems is probably not the worst approach, anyway. And that means using unicode symbols judiciously.

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [June 6, 2023, 10:54pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/54 "2023-06-06T22:54:15Z")

</div>

> [@Mason](#):
>
> there should be non-unicode API options available

Why?

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [June 6, 2023, 10:58pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/55 "2023-06-06T22:58:41Z")

</div>

I think it’s good practice because there are circumstances where someone is using a computing environment that is extremely limited in what sorts of inputs they can write or even display.

I don’t particularly feel strong about it, but I think it’s a good convention to provide optional ASCII interfaces in packages and from the base language.

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [June 6, 2023, 11:10pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/56 "2023-06-06T23:10:29Z")

</div>

What platforms are these where people are writing Julia code without the ability to type unicode?

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [June 6, 2023, 11:10pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/57 "2023-06-06T23:10:33Z")

</div>

While code with non-ascii symbols can be very nice to read, it is normally less nice to write. Even in environments where they are supported, it can be difficult to find out how to write them, and awkward to do so.

Some code is for reading, but APIs are essentially for _writing_, so I think there’s a different trade-off.

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [June 6, 2023, 11:11pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/58 "2023-06-06T23:11:26Z")

</div>

> [@DNF](#):
>
> it can be difficult to find out how to write them

Julia’s repl shows how to do it:

```julia
help?> α
"α" can be typed by \alpha<tab>

```

---

<div class="post-metadata">

**Author:** ![adienes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adienes/32/37459_2.png) [@adienes](https://discourse.julialang.org/u/adienes)\
**Post date:** [June 6, 2023, 11:12pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/59 "2023-06-06T23:12:18Z")

</div>

> [@jar1](#):
>
> ```julia
> help?> α
> "α" can be typed by \alpha<tab>
> 
> ```

```julia
help?> the one that looks like a little fish

```

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [June 6, 2023, 11:14pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/60 "2023-06-06T23:14:32Z")

</div>

Because they have a photograph of Julia code and don’t want to learn the greek alphabet despite working in a domain where it’s used, and don’t want to use [Detexify](https://detexify.kirelabs.org/classify.html)?

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/2/f2f144b6acf15811bea310678a5a650aa94871a7.png)

[Previous page](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897.md?page=2)

[Next page](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897.md?page=4)
