Sigh. These kind of homographs are the major problem I’ve found with using
Unicode, including my favorite phishing strategy:
http://en.wikipedia.org/wiki/IDN_homograph_attack
On my machine, I get exactly the same results as you:
# Using U.S. keyboard on OS X, type alt-m
julia> int('µ')
181
# Using Greek keyboard on OS x, type m
julia> int('μ')
956
I think this means that we need to change all of the code we’ve written that
uses Unicode to use only unambiguous ASCII characters. Allowing homographs in
any code that more than one person will ever edit is almost certainly going to
induce outbursts of rage at some point.
— John
On Jan 17, 2014, at 12:07 AM, David van Leeuwen <[email protected]>
wrote:
> Hi,
>
> My two cents,
>
> I started using μ and Σ in my code for normal distributions a while ago. On
> the mac, these symbols happen to exist in the US keyboard, but they turn out
> to in different unicode positions than the Greek alphabet letters, so
> apparently these option-US-keyboad entries have the meaning "micro" and
> "sum". On the screen, they look identical to the greek letters---so this can
> lead to bit of confusion.
>
> In my current working environment I have a full greek keyboard defined, and
> switch between US and greek using a shortcut command-space. This gives me
> fairly quick access to the full greek symbol repertoire without having to
> remember unicode codes.
>
> Cheers,
>
> ---david
>
> On Wednesday, January 15, 2014 5:26:57 PM UTC+1, Stefan Karpinski wrote:
> Since Julia source code can use Unicode identifiers, I thought this slightly
> off-topic blog post by John D. Cook might be useful to people:
>
> http://www.johndcook.com/symbols/2013/12/how-to-enter-unicode-characters/
>
> In particular, I learned about the Unicode Hex input mode for OS X.