2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: XiaoQiangYang - fatmole Downloaded source has error 2003-06-23 20:18 Hi all I download jasperreports-0.4.6-project,But can't compile it,Find error as followed .Java file JRStringUtil has error code. How to resovle this error? public static String xmlEncode(String text) { String ret = null; if (text != null) { ret = ""; for (int i = 0; i < text.length(); i ++) { switch (text.charAt(i)) { // case ' ' : ret += " "; break; case '&' : ret += "&"; break; case '>' : ret += ">"; break; case '<' : ret += "<"; break; case '�' : ret += "²"; break; case '�' : ret += "§"; break; case '�' : ret += "°"; break; case '"' : ret += """; break; case '�' : ret += "£"; break; case '�' : ret += "¤"; break; case '�' : ret += "µ"; break; case '�' : ret += "â"; break; case '�' : ret += "ê"; break; case '�' : ret += "î"; break; case '�' : ret += "ô"; break; case '�' : ret += "û"; break; case '�' : ret += "Â"; break; case '�' : ret += "Ê"; break; case '�' : ret += "Î"; break; case '�' : ret += "Ô"; break; case '�' : ret += "Û"; break; case '�' : ret += "ä"; break; case '�' : ret += "ë"; break; case '�' : ret += "ï"; break; case '�' : ret += "ö"; break; case '�' : ret += "ü"; break; case '�' : ret += "ÿ"; break; case '�' : ret += "Ä"; break; case '�' : ret += "Ë"; break; case '�' : ret += "Ï"; break; case '�' : ret += "Ö"; break; case '�' : ret += "Ü"; break; case '�' : ret += "à"; break; case '�' : ret += "è"; break; case '�' : ret += "ì"; break; case '�' : ret += "ò"; break; case '�' : ret += "ù"; break; case '�' : ret += "À"; break; case '�' : ret += "È"; break; case '�' : ret += "Ì"; break; case '�' : ret += "Ò"; break; case '�' : ret += "Ù"; break; case '�' : ret += "á"; break; case '�' : ret += "é"; break; case '�' : ret += "í"; break; case '�' : ret += "ó"; break; case '�' : ret += "ú"; break; case '�' : ret += "ý"; break; case '�' : ret += "Á"; break; case '�' : ret += "É"; break; case '�' : ret += "Í"; break; case '�' : ret += "Ó"; break; case '�' : ret += "Ú"; break; case '�' : ret += "Ý"; break; case '�' : ret += "ç"; break; case '�' : ret += "Ç"; break; case '�' : ret += "ñ"; break; case '�' : ret += "Ñ"; break; case '�' : ret += "å"; break; case '�' : ret += "Å"; break; case '�' : ret += "ø"; break; case '�' : ret += "Ø"; break; default : ret += text.substring(i, i + 1); break; } } } return ret; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now