Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add utf-8 header to xml output
  • Loading branch information
garazdawi committed Sep 23, 2011
1 parent f773485 commit fcb9380
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cth_junit.erl
Expand Up @@ -117,6 +117,7 @@ get_suite(TCs) ->

terminate(State) ->
{ok,D} = file:open(State#state.filepath,[write]),
io:format(D, "<?xml version=\"1.0\" encoding= \"UTF-8\" ?>", []),
io:format(D, to_xml(State#state.test_suites), []),
catch file:sync(D),
catch file:close(D).
Expand Down Expand Up @@ -145,7 +146,7 @@ sanitize([$>|T]) ->
sanitize([$<|T]) ->
"&lt;" ++ sanitize(T);
sanitize([$"|T]) ->
"&#34;" ++ sanitize(T);
"&quot;" ++ sanitize(T);
sanitize([$'|T]) ->
"&apos;" ++ sanitize(T);
sanitize([$&|T]) ->
Expand Down

0 comments on commit fcb9380

Please sign in to comment.