anchor.diff:  
   %%%-----------------------------------------------------------------
   %%% Add a link target for each line and one for each function definition.
  -build_html(SFd,DFd,Functions) ->
  -    build_html(SFd,DFd,file:read_line(SFd),1,Functions,false).
  -
  -build_html(SFd,DFd,{ok,Str},L,[{F,A,L}|Functions],_IsFuncDef) ->
  +build_html(SFd,DFd,Encoding,Functions) ->
  +    build_html(SFd,DFd,Encoding,file:read_line(SFd),1,Functions,false).
  +
  +build_html(SFd,DFd,Encoding,{ok,Str},L,[{F,A,L}|Functions],_IsFuncDef) ->
       FALink = http_uri:encode(F++"-"++integer_to_list(A)),
  -    file:write(DFd,["<a name=\"",FALink,"\"/>"]),
  -    build_html(SFd,DFd,{ok,Str},L,Functions,true);
  -build_html(SFd,DFd,{ok,Str},L,[{clause,L}|Functions],_IsFuncDef) ->
  -    build_html(SFd,DFd,{ok,Str},L,Functions,true);
  -build_html(SFd,DFd,{ok,Str},L,Functions,IsFuncDef) ->
  +    file:write(DFd,["<a name=\"",to_raw_list(FALink,Encoding),"\"/>"]),
  +    build_html(SFd,DFd,Encoding,{ok,Str},L,Functions,true);
  +build_html(SFd,DFd,Encoding,{ok,Str},L,[{clause,L}|Functions],_IsFuncDef) ->
  +    build_html(SFd,DFd,Encoding,{ok,Str},L,Functions,true);
  +build_html(SFd,DFd,Encoding,{ok,Str},L,Functions,IsFuncDef) ->
       LStr = line_number(L),
       Str1 = line(Str,IsFuncDef),
       file:write(DFd,[LStr,Str1]),
  -    build_html(SFd,DFd,file:read_line(SFd),L+1,Functions,false);
  -build_html(_SFd,_DFd,eof,L,_Functions,_IsFuncDef) ->
  +    build_html(SFd,DFd,Encoding,file:read_line(SFd),L+1,Functions,false);
  +build_html(_SFd,_DFd,_Encoding,eof,L,_Functions,_IsFuncDef) ->
       L.
   
   line_number(L) ->
  
positive.code: %%
  %% %CopyrightBegin%
  %% 
  %% Copyright Ericsson AB 1997-2012. All Rights Reserved.
  %% 
  %% The contents of this file are subject to the Erlang Public License,
  %% Version 1.1, (the "License"); you may not use this file except in
  
negative.code: %%%-----------------------------------------------------------------
  %%% Read encoding from source file
  encoding(File) ->
      case epp:read_encoding(File) of
  	none ->
  	    epp:default_encoding();
  	E ->
  	    E
      end.
  
  %%%-----------------------------------------------------------------
  %%% Covert encoding atom to string for use in HTML header
  html_encoding(latin1) ->
      "iso-8859-1";
  html_encoding(utf8) ->
      "utf-8".
  
  %%%-----------------------------------------------------------------
  %%% Convert a string to a list of raw printable characters in the
  %%% given encoding.  This is necessary since the files (source and
  %%% destination) are both opened in raw mode (default encoding). Byte
  %%% by byte is read from source and written to the destination. This
  %%% conversion is needed when printing data that is not first read
  %%% from the source.
  %%%
  %%% Example: if the encoding of the file is utf8, and we have a string
  %%% containing "" = [229], then we need to convert this to [195,165]
  %%% before writing. Note that this conversion is only necessary
  %%% because the destination file is not (necessarily) opened with utf8
  %%% encoding - it is opened with default encoding in order to allow
  %%% raw file mode and byte by byte copying from source.
  to_raw_list(X,latin1) when is_list(X) ->
      X;
  to_raw_list(X,utf8) when is_list(X) ->
      binary_to_list(unicode:characters_to_binary(X)).
  