anchor.diff:          
           propertyfile += "\n"+key+" = "+value+"\n";
   		
  -		return propertyfile;
  -	}
  -	
  +        return propertyfile;
  +    }
  +    
  +    public static String safeGetParameter( ServletRequest request, String name )
  +    {
  +        try
  +        {
  +            String res = request.getParameter( name );
  +            if( res != null ) 
  +            {
  +                res = new String(res.getBytes("ISO-8859-1"),
  +                                 "UTF-8" );
  +            }
  +
  +            return res;
  +        }
  +        catch( UnsupportedEncodingException e )
  +        {
  +            // Should never happen
  +            return "";
  +        }
  +
  +    }
       public void writeProperties( File propertyFile, String contents )
           throws IOException
       {
  -        byte[] bytes = contents.getBytes("ISO-8859-1");
  +        byte[] bytes = contents.getBytes();
           OutputStream out = null;
           
           try
  
positive.code:         return f;
      }
      
  	public String readProperties( ServletContext context )
  		throws IOException
  	{
          File f = findPropertyFile( context );
  		FileReader in = null;
  		String contents = null;
  		try
  		{
  			in = new FileReader( f );
              contents = FileUtil.readContents( in );
  		}
  		finally
  		{
  			if( in != null ) in.close();
  		}
  		
  		return contents;
  	}
  %>
  
  <%
      String propertyString = readProperties( getServletContext() );
      
      Properties props = new Properties();
      props.load( new ByteArrayInputStream(propertyString.getBytes("ISO-8859-1")) );
      
  
      String appname = request.getParameter( "appname" );
      String baseurl = request.getParameter( "baseurl" );
      String dir = request.getParameter( "dir" );
      String logdir = request.getParameter( "logdir" );
      String workdir = request.getParameter( "workdir" );
      String password1 = request.getParameter( "password1" );
      String password2 = request.getParameter( "password2" );
      String password  = request.getParameter( "password" );
  
      String oldpassword = props.getProperty( "jspwiki.auth.masterPassword", null );
      
  
negative.code:                     continue;
                  }
              }
              int eqsign = propertyfile.indexOf("=",idx);
  			
              if( eqsign != -1 )
              {
                  int ret = propertyfile.indexOf("\n",eqsign);
  				
                  if( ret == -1 ) ret = propertyfile.length();
  				
                  propertyfile = TextUtil.replaceString( propertyfile, eqsign+1, ret, value );
                  
                  return propertyfile;
              }
              // idx += key.length();
          }
  
          //
          //  If it was not found, we'll add it here.
  