aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-10-11 16:40:43 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-10-11 16:40:43 +0200
commit9f9f63e3919a5703c3dd05948b2990df608cf9f5 (patch)
treeb13b6cc78dac7361b6c4938f4d82ff79771585f8
parent9d3fc7af810302009c031c642be7c867e211d815 (diff)
downloadotp-9f9f63e3919a5703c3dd05948b2990df608cf9f5.tar.gz
otp-9f9f63e3919a5703c3dd05948b2990df608cf9f5.tar.bz2
otp-9f9f63e3919a5703c3dd05948b2990df608cf9f5.zip
Reformat docgen xml encoding
epp:default_encoding/0 returns 'utf8' and needs to be re-encoded to "UTF-8" to be correct.
-rw-r--r--lib/erl_docgen/src/docgen_edoc_xml_cb.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
index 4f3af1f767..13ff0a139d 100644
--- a/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
+++ b/lib/erl_docgen/src/docgen_edoc_xml_cb.erl
@@ -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),