# Syntax: Escape hatch for unicode haters

**URL:** <https://discourse.julialang.org/t/syntax-escape-hatch-for-unicode-haters/108363>\
**Category:** Internals & Design\
**Tags:** syntax, unicode\
**Created:** [January 4, 2024, 11:55pm UTC](https://discourse.julialang.org/t/syntax-escape-hatch-for-unicode-haters/108363 "2024-01-04T23:55:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 5, 2024, 12:17am UTC](https://discourse.julialang.org/t/syntax-escape-hatch-for-unicode-haters/108363/2 "2024-01-05T00:17:15Z")

</div>

> [@foobar\_lv2](#):
>
> Now I’d also like to get a non-unicode escape hatch for symbol and operator positions

You can do something now with a string macro, no parser changes needed:

```julia
macro uvar_str(s::AbstractString)
   sym = Meta.parse(unescape_string(s))
   sym isa Symbol || throw(ArgumentError("expecting a single symbol"))
   return esc(sym)
end

```

Which lets you do e.g.:

```julia
julia> uvar"\ub5" = 3
3

julia> µ
3

julia> uvar"\u2208"('b', "foobar") # 'b' ∈ "foobar"
true

```

If you want to be a friendlier you could support REPL tab completions too (by calling the REPLCompletions module), or implement even more LaTeX syntax.

It would be an easy thing to put into a module, e.g. `UnicodeHaters.jl` or `ASCIIJulia.jl` for people who want this kind of thing.

PS. I think it’s generally good style for APIs to provide ASCII synonyms, but there are exceptions, e.g. the Gridap.jl package uses Unicode so extensively in its API that it’s hard to imagine it without it.

---

_[View the full topic](https://discourse.julialang.org/t/syntax-escape-hatch-for-unicode-haters/108363)._
