diff options
author | Magnus Lidén <[email protected]> | 2014-07-02 09:42:19 +0200 |
---|---|---|
committer | Magnus Lidén <[email protected]> | 2014-07-02 09:42:19 +0200 |
commit | fbc5f26d8f00277aca13fd97a0eef2423446c249 (patch) | |
tree | 2128e7a886d14c27f05bd63af068f875b6f839ef /lib/syntax_tools/src/erl_comment_scan.erl | |
parent | d2ade9b27432a1f7342e231d0d8b12467c3d3d77 (diff) | |
parent | a7176f9186ffd7eb2b26daca2264d425383cf6a7 (diff) | |
download | otp-fbc5f26d8f00277aca13fd97a0eef2423446c249.tar.gz otp-fbc5f26d8f00277aca13fd97a0eef2423446c249.tar.bz2 otp-fbc5f26d8f00277aca13fd97a0eef2423446c249.zip |
Merge branch 'maint-17' into maint
Diffstat (limited to 'lib/syntax_tools/src/erl_comment_scan.erl')
-rw-r--r-- | lib/syntax_tools/src/erl_comment_scan.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/syntax_tools/src/erl_comment_scan.erl b/lib/syntax_tools/src/erl_comment_scan.erl index dae7530ce7..03429d4d42 100644 --- a/lib/syntax_tools/src/erl_comment_scan.erl +++ b/lib/syntax_tools/src/erl_comment_scan.erl @@ -72,13 +72,24 @@ file(Name) -> {ok, V} -> case V of {ok, B} -> - Enc = case epp:read_encoding(Name) of + Encoding = epp:read_encoding_from_binary(B), + Enc = case Encoding of none -> epp:default_encoding(); Enc0 -> Enc0 end, case catch unicode:characters_to_list(B, Enc) of String when is_list(String) -> string(String); + R when Encoding =:= none -> + case + catch unicode:characters_to_list(B, latin1) + of + String when is_list(String) -> + string(String); + _ -> + error_read_file(Name1), + exit(R) + end; R -> error_read_file(Name1), exit(R) |