可以替换的
 // Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov  Date: 2004-4-19 18:17:25
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   DoText.javapackage com.jamry;import java.io.PrintStream;
import java.io.UnsupportedEncodingException;public class DoText
{    public DoText()
    {
    }    public String[] split(String s, String s1)
    {
        int i = 0;
        int j = 0;
        boolean flag = false;
        int i1 = s1.length();
        if(s.compareTo("") != 0)
        {
            if(s.indexOf(s1) != -1)
            {
                j = s.indexOf(s1);
                int j1 = 1;
                do
                {
                    if(s.indexOf(s1, j + i1) != -1)
                    {
                        j = s.indexOf(s1, j + i1);
                        i = j1;
                    } else
                    {
                        i += 2;
                        break;
                    }
                    j1++;
                } while(true);
            } else
            {
                i = 1;
            }
        } else
        {
            i = 0;
        }
        j = 0;
        flag = false;
        String as[] = new String[i];
        if(s.compareTo("") != 0)
        {
            if(s.indexOf(s1) != -1)
            {
                int k = s.indexOf(s1);
                as[0] = s.substring(0, k);
                int k1 = 1;
                do
                {
                    if(s.indexOf(s1, k + i1) != -1)
                    {
                        int l = s.indexOf(s1, k + i1);
                        as[k1] = s.substring(k + i1, l);
                        k = s.indexOf(s1, k + i1);
                    } else
                    {
                        as[k1] = s.substring(k + i1, s.length());
                        break;
                    }
                    k1++;
                } while(true);
            } else
            {
                as[0] = s.substring(0, s.length());
                return as;
            }
        } else
        {
            return as;
        }
        return as;
    }    public String dealNull(String s)
    {
        String s1 = null;
        if(s == null)
            s1 = "";
        else
            s1 = s;
        return s1;
    }    public Object dealNull(Object obj)
    {
        Object obj1 = null;
        if(obj == null)
            obj1 = "";
        else
            obj1 = obj;
        return obj1;
    }    int dealEmpty(String s)
    {
        s = dealNull(s);
        if(s.equals(""))
            return 0;
        else
            return Integer.parseInt(s);
    }    public String replace(String s, String s1, String s2)
    {
        String as[] = split(s, s1);
        String s3 = null;
        if(as.length != 0)
        {
            s3 = as[0];
            for(int i = 0; i < as.length - 1; i++)
                s3 = dealNull(s3) + s2 + as[i + 1];        }
        return dealNull(s3);
    }    public String addBr(String s)
    {
        if(s != null)
            s = replace(s, "\n", "<br>");
        return s;
    }    public String addColon(String s)
    {
        if(s != null)
            s = replace(s, "<br>", ":<br>");
        return s;
    }    public String changeColor(String s)
    {
        if(s != null)
        {
            s = replace(s, "<br>", "</font><br>");
            s = replace(s, "<br>:", "<br><font color=#408080>:");
        }
        return s;
    }    public String delBr(String s)
    {
        if(s != null)
            s = replace(s, "<br>", "");
        return s;
    }    public String addSlashes(String s)
    {
        if(s != null)
        {
            s = replace(s, "\\", "\\\\");
            s = replace(s, "'", "\\'");
        }
        return s;
    }    public String stripslashes(String s)
    {
        if(s != null)
        {
            s = replace(s, "\\\\", "\\");
            s = replace(s, "'", "'");
            s = replace(s, "\\\"", "\"");
            s = replace(s, "\\&quot;", "\"");
        }
        return s;
    }    public String htmlEncode(String s)
    {
        if(s != null)
        {
            s = replace(s, "&", "&amp;");
            s = replace(s, "&amp;amp;", "&amp;");
            s = replace(s, "&amp;quot;", "&quot;");
            s = replace(s, "\"", "&quot;");
            s = replace(s, "&amp;lt;", "&lt;");
            s = replace(s, "<", "&lt;");
            s = replace(s, "&amp;gt;", "&gt;");
            s = replace(s, ">", "&gt;");
            s = replace(s, "&amp;nbsp;", "&nbsp;");
        }
        return s;
    }    public String unHtmlEncode(String s)
    {
        if(s != null)
        {
            s = replace(s, "&amp;", "&");
            s = replace(s, "&quot;", "\"");
            s = replace(s, "&lt;", "<");
            s = replace(s, "&gt;", ">");
            s = replace(s, "&nbsp;", " ");
        }
        return s;
    }    public String ScriptEncode(String s)
    {
        if(s != null)
        {
            s = replace(s, "script", " ");
            s = replace(s, "SCRIPT", " ");
            s = replace(s, "Script", " ");
            s = replace(s, "SCript", " ");
        }
        return s;
    }    public String iso2gb(String s)
    {
        if(s != null)
        {
            byte abyte0[] = null;
            try
            {
                abyte0 = s.getBytes("ISO8859_1");
            }
            catch(UnsupportedEncodingException unsupportedencodingexception)
            {
                System.out.println("Error: Method: dbconn.iso2gb :" + unsupportedencodingexception.getMessage());
            }
            try
            {
                s = new String(abyte0, "GBK");
            }
            catch(UnsupportedEncodingException unsupportedencodingexception1)
            {
                System.out.println("Error: Method: dbconn.gb2iso :" + unsupportedencodingexception1.getMessage());
            }
        }
        return s;
    }    public String gb2iso(String s)
    {
        if(s != null)
        {
            byte abyte0[] = null;
            try
            {
                abyte0 = s.getBytes("GBK");
            }
            catch(UnsupportedEncodingException unsupportedencodingexception)
            {
                System.out.println("Error: Method: dbconn.gb2iso :" + unsupportedencodingexception.getMessage());
            }
            try
            {
                s = new String(abyte0, "ISO8859_1");
            }
            catch(UnsupportedEncodingException unsupportedencodingexception1)
            {
                System.out.println("Error: Method: dbconn.gb2iso :" + unsupportedencodingexception1.getMessage());
            }
        }
        return s;
    }
}