anchor.diff:          return s.trim();
       }
       
  -	public String setProperty( String propertyfile, String key, String value )
  -	{
  +    public String setProperty( String propertyfile, String key, String value )
  +    {
           int idx = 0;
           
  -		while( (idx < propertyfile.length()) && ((idx = propertyfile.indexOf(key,idx)) != -1) )
  -		{
  +        value = TextUtil.native2Ascii( value );
  +        
  +        while( (idx < propertyfile.length()) && ((idx = propertyfile.indexOf(key,idx)) != -1) )
  +        {
               int prevret = propertyfile.lastIndexOf("\n",idx);
               if( prevret != -1 )
               {
  
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:         
          propertyfile += "\n"+key+" = "+value+"\n";
  		
          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();
          OutputStream out = null;
          
          try
  