Skip to content

Commit

Permalink
Merge branch 'egil/erl_docgen/reformat-docgen-encoding/OTP-13971' int…
Browse files Browse the repository at this point in the history
…o maint

* egil/erl_docgen/reformat-docgen-encoding/OTP-13971:
  Reformat docgen xml encoding
  • Loading branch information
psyeugenic committed Oct 17, 2016
2 parents 74adb84 + 9f9f63e commit 8cddd56
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/erl_docgen/src/docgen_edoc_xml_cb.erl
Expand Up @@ -111,7 +111,16 @@ root_attributes(Element, Opts) ->
Enc ->
Enc
end,
[#xmlAttribute{name=encoding, value=Encoding}].
[#xmlAttribute{name=encoding, value=reformat_encoding(Encoding)}].

%% epp:default_encoding/0 returns 'utf8'
reformat_encoding(utf8) -> "UTF-8";
reformat_encoding(List) when is_list(List) ->
case string:to_lower(List) of
"utf8" -> "UTF-8";
_ -> List
end;
reformat_encoding(Other) -> Other.

layout_chapter(#xmlElement{name=overview, content=Es}) ->
Title = get_text(title, Es),
Expand Down

0 comments on commit 8cddd56

Please sign in to comment.