Browse files

allow files that arent written to index, change encoding to latin1

  • Loading branch information...
1 parent 24ed633 commit 7f9e306a65a3933daaeb2ce292e0db24be9dff9b @daleharvey committed Aug 19, 2010
Showing with 3 additions and 4 deletions.
  1. +1 −1 priv/static/erldocs.tpl
  2. +2 −3 src/erldocs.erl
@@ -2,7 +2,7 @@
<html lang="en">
- <meta charset="utf-8" />
+ <meta charset="latin1" />
<title>#TITLE# - (Erlang Documentation)</title>
<link type="text/css" rel="stylesheet" href="#BASE#erldocs.css" />
@@ -122,10 +122,9 @@ ensure_docsrc(AppDir, Conf) ->
gen_docsrc(AppDir) ->
Includes = filelib:wildcard(AppDir ++ "/include"),
- Files = [ try ok = docb_gen:module(File, [{includes, Includes}]),
+ Files = [ begin
+ catch docb_gen:module(File, [{includes, Includes}]),
AppDir ++ "/doc/src/" ++ bname(File, ".erl") ++ ".xml"
- catch
- _:_ -> ignore
end || File <- filelib:wildcard(AppDir ++ "/*.erl") ++
filelib:wildcard(AppDir ++ "/src/*.erl")],

3 comments on commit 7f9e306


etrepum replied Aug 20, 2010

I think that only OTP has latin1 docs... we don't currently have anything funny in our source code but with some Chinese programmers here I think we will end up with utf-8 eventually. Maybe there is some way to sniff the file to see if it's latin1, and transcode to utf-8 if it is?


daleharvey replied Aug 20, 2010

yeh the latin1 was strange, I was trying to avoid doing any conversions when I can, but I think it would be easiest to just chuck in the config as an option which defaults to utf-8 when its not there, I forgot I already have to specify the encoding when I read the xml so utf8 would probably break right now anway.

so just {encoding, "latin1"}, {encoding, "utf8"} in the config sound reasonable?, "utf8" if it doesnt exist (so pretty much everyone can ignore it all, but the otp docs still work)


daleharvey replied Aug 20, 2010

actually thats dumb because you couldnt use utf8 on your own stuff and mix with the latin1 in otp, ill just attempt utf8 and fallback to latin1 + convert if it dies

Please sign in to comment.