Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2017 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2e8babd349167a49eb6f6d55ec0505c9 to your computer and use it in GitHub Desktop.
Save anonymous/2e8babd349167a49eb6f6d55ec0505c9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env escript
%% -*- coding: utf-8 -*-
%%! +pc unicode
-module(hello).
%-mode(compile).
-export([main/1, 'hello_юникод_世界,'/0]).
main(_) ->
% io:format("~p~n", [{io:printable_range(), io:getopts()}]),
% 'hello_'(),
io:setopts([{encoding,unicode}]),
% io:format("~p~n", [{io:printable_range(), io:getopts()}]),
'hello_юникод_世界,'(),
io:format("~tp~n", [{"Hello, 世界, юникод"}]).
'hello_юникод_世界,'() ->
io:format("~tp~n", [{'hello_юникод', <<"Hello, 世界; юникод"/utf8>>, "Hello, 世界; юникод"}]).
@c0b
Copy link

c0b commented May 31, 2017

@kvakvs the Java world, and JavaScript supported Unicode identifier since the very beginning (since 90s?) and supported by many other programming languages as I know; did any of those get out of control 😄 ?

 ./opt/node-v8.0.0-linux-x64/bin/node
> var hello_юникод_世界 = 42;
undefined
> hello_юникод_世界
42
> console.log(hello_юникод_世界);
42
undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment