anchor.diff:      run(Port).
   
   run(P) ->
  -    put(unicode,false),
  +    put(encoding, latin1),
       server_loop(P).
   
   server_loop(Port) ->
  
positive.code: %% New in R13B
  % Wide characters (Unicode)
  io_request({put_chars,Encoding,Chars}, Port) -> % Binary new in R9C
      put_chars(wrap_characters_to_binary(Chars,Encoding,
  					case get(unicode) of 
  					    true -> unicode;
  					    _ -> latin1
  					end), Port);
  io_request({put_chars,Encoding,Mod,Func,Args}, Port) ->
      Result = case catch apply(Mod,Func,Args) of
  		 Data when is_list(Data); is_binary(Data) ->
  		     wrap_characters_to_binary(Data,Encoding,
  					       case get(unicode) of 
  						   true -> unicode;
  						   _ -> latin1
  					       end);
  		 Undef ->
  		     Undef
  	     end,
  
negative.code:     end.
  
  %% setopts
  setopts(Opts0) ->
      Opts = expand_encoding(Opts0),
      case check_valid_opts(Opts) of
          true ->
              do_setopts(Opts);
          false ->
              {error,{error,enotsup}}
      end.
  
  check_valid_opts([]) ->
      true;
  check_valid_opts([{encoding,Valid}|T]) when Valid =:= unicode;
                                              Valid =:= utf8; Valid =:= latin1 ->
      check_valid_opts(T);
  check_valid_opts(_) ->
      false.
  
  expand_encoding([]) ->
      [];
  expand_encoding([latin1 | T]) ->
      [{encoding,latin1} | expand_encoding(T)];
  expand_encoding([unicode | T]) ->
      [{encoding,unicode} | expand_encoding(T)];
  expand_encoding([H|T]) ->
      [H|expand_encoding(T)].
  
  do_setopts(Opts) ->
      case proplists:get_value(encoding, Opts) of
          Valid when Valid =:= unicode; Valid =:= utf8 ->
              put(encoding, unicode);
          latin1 ->
              put(encoding, latin1);
          undefined ->
              ok
      end,
      {ok,ok}.
  
  getopts() ->
      Uni = {encoding,get(encoding)},
      {ok,[Uni]}.
  
  wrap_characters_to_binary(Chars,From,To) ->
  