diff options
author | Hans Bolinder <[email protected]> | 2013-03-18 15:31:07 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2013-03-19 13:03:01 +0100 |
commit | f247d246725d76412242e547e7c212bf947542f8 (patch) | |
tree | cfa871edd7a69c0004608cb8eaf97b375bcae201 /lib/stdlib/test/escript_SUITE_data | |
parent | 395e5870020df6807c6e73462e75d594a07e40a8 (diff) | |
download | otp-f247d246725d76412242e547e7c212bf947542f8.tar.gz otp-f247d246725d76412242e547e7c212bf947542f8.tar.bz2 otp-f247d246725d76412242e547e7c212bf947542f8.zip |
Let escript recognize an encoding comment on the second line
The manual says that an Emacs directive can be placed on the second
line. With this patch that directive is also recognized when selecting
encoding of the script.
Diffstat (limited to 'lib/stdlib/test/escript_SUITE_data')
-rwxr-xr-x | lib/stdlib/test/escript_SUITE_data/unicode3 | 2 | ||||
-rwxr-xr-x | lib/stdlib/test/escript_SUITE_data/unicode4 | 12 | ||||
-rwxr-xr-x | lib/stdlib/test/escript_SUITE_data/unicode5 | 12 | ||||
-rwxr-xr-x | lib/stdlib/test/escript_SUITE_data/unicode6 | 13 |
4 files changed, 38 insertions, 1 deletions
diff --git a/lib/stdlib/test/escript_SUITE_data/unicode3 b/lib/stdlib/test/escript_SUITE_data/unicode3 index 944487dcae..0702ecf309 100755 --- a/lib/stdlib/test/escript_SUITE_data/unicode3 +++ b/lib/stdlib/test/escript_SUITE_data/unicode3 @@ -1,5 +1,5 @@ #!/usr/bin/env escript -%% -*- erlang; coding: utf-8 -*- +%% -*- erlang; coding: latin-1 -*- -export([main/1]). diff --git a/lib/stdlib/test/escript_SUITE_data/unicode4 b/lib/stdlib/test/escript_SUITE_data/unicode4 new file mode 100755 index 0000000000..a7563a613a --- /dev/null +++ b/lib/stdlib/test/escript_SUITE_data/unicode4 @@ -0,0 +1,12 @@ +#!/usr/bin/env escript +%% -*- erlang; encoding:utf-8 -*- + +-export([main/1]). + +main(_) -> + ok = io:setopts([{encoding,unicode}]), + Bin1 = <<"örn_Рש×××-ש×××+×©× æ¥æ¬èª">>, + L = [246,114,110,95,1024,32,1513,1500,1493,1501,45,1513,1500,1493, + 1501,43,1513,1500,32,26085,26412,35486], + L = unicode:characters_to_list(Bin1, utf8), + ok. diff --git a/lib/stdlib/test/escript_SUITE_data/unicode5 b/lib/stdlib/test/escript_SUITE_data/unicode5 new file mode 100755 index 0000000000..e95da3361d --- /dev/null +++ b/lib/stdlib/test/escript_SUITE_data/unicode5 @@ -0,0 +1,12 @@ +#!/usr/bin/env escript +%% -*- erlang -*- +-export([main/1]). +%% -*- encoding:latin-1 -*- + +main(_) -> + ok = io:setopts([{encoding,unicode}]), + Bin1 = <<"örn_Ѐ שלום-שלום+של 日本語">>, + L = [246,114,110,95,1024,32,1513,1500,1493,1501,45,1513,1500,1493, + 1501,43,1513,1500,32,26085,26412,35486], + L = unicode:characters_to_list(Bin1, utf8), + ok. diff --git a/lib/stdlib/test/escript_SUITE_data/unicode6 b/lib/stdlib/test/escript_SUITE_data/unicode6 new file mode 100755 index 0000000000..8027a2a08c --- /dev/null +++ b/lib/stdlib/test/escript_SUITE_data/unicode6 @@ -0,0 +1,13 @@ +#!/usr/bin/env escript +%% -*- erlang -*- +%%! +pc unicode +-export([main/1]). +%% -*- encoding:utf-8 -*- + +main(_) -> + ok = io:setopts([{encoding,unicode}]), + Bin1 = <<"örn_Рש×××-ש×××+×©× æ¥æ¬èª">>, + L = [246,114,110,95,1024,32,1513,1500,1493,1501,45,1513,1500,1493, + 1501,43,1513,1500,32,26085,26412,35486], + L = unicode:characters_to_list(Bin1, utf8), + ok. |