Julia has better support for math symbols than I believe any other language, also supporting a lot of emojis e.g. Beer Mug and \:baby_bottle: (do not mix together).
That said, what’s the use case, as I would be a bit annoyed seeing e.g. my name Páll shown as as Pll, dropping a letter, (Palli is a nickname; I use it also to help foreigners, easier to say), or Icelandic Þ and Ð as \\TH and \\DH, so “working” partially for some (and fully for only a few, except for ASCII-only) names, like Þórður, to \\THr\\dhur (missing out on the ó)?
I’ve never encountered filename with unicode from my work experience. My colleagues never use it. It may cause many problems, who knows? For example, they don’t know how to type the filename with unicode? Using plain ASCII can avoid such headaches.
I think you mean, you never use fullwidth Unicode (e.g. Chinese characters) vs halfwidth (e.g. ASCII but not only), understandable, still interesting.
Unicode, i.e. UTF-8, is ubiquitous on Linux (and Unicode, there UTF-16, on Windows) on filesystems. I’ve probably used UTF-8 only, for well over a decade, and filenames in Icelandic or e.g. German work fine. I often use ASCII subset for work reasons (and personally often out of habit), since I work for a British (actually Hong Kong) company, and English is the default language. I use Julia at work, and I guess I could use Unicode (math symbols) in the Julia code, so far haven’t, and it should work in filesystems, while I’m more afraid then of Linux and Windows servers cooperating well.
Should work fine on any recent (< 10 yo) OS. If not, the problem can easily be remedied.
They can copy-paste or open the file using an interactive file dialog.
There are exceptions (ancient mainframes etc), but generally a custom ad-hoc workaround (like the transcription proposed above) is likely to take more effort and be less robust than setting up a filesystem that can handle Unicode.
We have many legacy C++ library and I actually don’t know if unicode filename works out of box using C++ iostream. No one of us probably want to update those C++ code. Before we transfer all those C++ codes to Julia, we’d better to adhere to filenames with pure ASCII characters. That is another reason I don’t like to save a data file with name such as “ϕ0.1_α0.5.dat”.
It will on Mac and Linux, where filenames are all UTF-8 encoded — all of the C/C++ libraries treat filenames as an opaque collection of bytes and don’t care about the encoding, and so they handle arbitrary Unicode filenames automatically.
On Windows, unfortunately, you need to use special UTF-16 or wchar_t filesystem APIs (wiostream) to access Unicode filenames from C/C++. (The Win32 API took a wrong turn early in the development of Unicode and never recovered. However, there is hope that this will change soon and UTF-8 usage will become widespread on Windows — it’s apparently become possible to use the ordinary C/C++ APIs with UTF-8 encoded filenames, and this may yet become the default.)
I use it very often since Serbian language has letters š, đ, ž, č, ć which aren’t ASCII. Naming my files and folders in such way is way more readable and intuitive. I still haven’t encountered any problems with that, but maybe it’s because I always name my software development files in English.
People even use UTF-8 on (recent) mainframes (UTF-EBCDIC never got popular), while probably not for most programs, and not sure about for actual filenames: IBM Documentation
ϵ̂ doesn’t have a single tab completion (it’s \epsilon<tab>\hat<tab>) so symbol_latex won’t work.
You have to break it up into characters similar to this logic.
function translate_to_ascii(x::Symbol)
s = Unicode.normalize(string(x), :NFD)
latex = [REPL.symbol_latex(string(i))[2:end] for i in s]
join(latex,"_")
end
translate_to_ascii(:α̂ₗ)
# "alpha_hat__l"
function translate_to_ascii(x::Symbol)
s = Unicode.normalize(string(x), :NFD)
latex = String[]
for i in ss
out = REPL.symbol_latex(string(i))[2:end]
if out == ""
out = string(i)
end
push!(latex,out)
end
join(latex,"_")
end
translate_to_ascii(:l1α̂ₗ)