diff options
author | Siri Hansen <[email protected]> | 2013-01-23 14:58:40 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2013-01-25 15:56:00 +0100 |
commit | f234422cd0599a935909da936ea8893cb2087f9a (patch) | |
tree | cf1ccb99930e05c48e0914ed2712e6c17055d610 | |
parent | 0df8de4fa21d650b3f2795e3aa6d29952e4b08de (diff) | |
download | otp-f234422cd0599a935909da936ea8893cb2087f9a.tar.gz otp-f234422cd0599a935909da936ea8893cb2087f9a.tar.bz2 otp-f234422cd0599a935909da936ea8893cb2087f9a.zip |
[test_server] Ensure correct encoding in header for erl2html2:convert
When running under framework common_test, the encoding statement in
the HTML header of the file generated with erl2html2:convert would
sometimes be faulty. This has been corrected.
-rw-r--r-- | lib/test_server/src/test_server_ctrl.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl index f800b93d0c..b7e7926fd6 100644 --- a/lib/test_server/src/test_server_ctrl.erl +++ b/lib/test_server/src/test_server_ctrl.erl @@ -1874,7 +1874,8 @@ html_possibly_convert(Src, SrcInfo, Dest) -> OutDir = get(test_server_log_dir_base), case test_server_sup:framework_call(get_html_wrapper, ["Module "++Src,false, - OutDir,undefined], "") of + OutDir,undefined, + encoding(Src)], "") of Empty when (Empty == "") ; (element(2,Empty) == "") -> erl2html2:convert(Src, Dest); {_,Header,_} -> @@ -5368,3 +5369,11 @@ reserved() -> sets:from_list([$;, $:, $@, $&, $=, $+, $,, $/, $?, $#, $[, $], $<, $>, $\", ${, $}, $|, $\\, $', $^, $%, $ ]). + +encoding(File) -> + case epp:read_encoding(File) of + none -> + epp:default_encoding(); + E -> + E + end. |