[Kafenio-cvs-commit] kafenio_main/src/de/xeinfach/kafenio KafenioPanel.java,1.7,1.8
Status: Beta
Brought to you by:
netsrak
|
From: <ne...@pr...> - 2004-01-26 16:48:53
|
Update of /cvsroot/kafenio/kafenio_main/src/de/xeinfach/kafenio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15628/src/de/xeinfach/kafenio Modified Files: KafenioPanel.java Log Message: - fixed java 1.3 compatibility issues Index: KafenioPanel.java =================================================================== RCS file: /cvsroot/kafenio/kafenio_main/src/de/xeinfach/kafenio/KafenioPanel.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** KafenioPanel.java 26 Jan 2004 16:31:12 -0000 1.7 --- KafenioPanel.java 26 Jan 2004 16:47:50 -0000 1.8 *************** *** 2174,2178 **** bodyContent = Base64Codec.encode(getDocumentBody()); } else { ! bodyContent = URLEncoder.encode(getDocumentBody(),"UTF-8"); } urlFetcher.setPOSTData(getConfig().getContentParameter()+"="+bodyContent); --- 2174,2188 ---- bodyContent = Base64Codec.encode(getDocumentBody()); } else { ! try { ! if (System.getProperty("java.version").substring(0, 3).equals("1.4")) { ! bodyContent = URLEncoder.encode(getDocumentBody(), "UTF-8"); ! } else { ! // support for urlencoding in java 1.3 ! bodyContent = URLEncoder.encode(getDocumentBody()); ! } ! } catch (Exception e) { ! // if system property cannot be read, encode using old encode() method. ! bodyContent = URLEncoder.encode(getDocumentBody()); ! } } urlFetcher.setPOSTData(getConfig().getContentParameter()+"="+bodyContent); *************** *** 2212,2228 **** */ public void setDocumentText(String sText) { - // dirty hack around JDK bug 4799813 - // see http://developer.java.sun.com/developer/bugParade/bugs/4799813.html - // regression in 1.4.x, to be fixed in 1.5 - // When setting the text to be "& footext", it becomes "&footext" (space disappears) - try { - if (System.getProperty("java.version").substring(0, 3).equals("1.4")) { - java.util.regex.Pattern pattern = null; - if (pattern == null) - pattern = java.util.regex.Pattern.compile("(&\\w+;|&#\\d+;)(\\s|<)"); - sText = pattern.matcher(sText).replaceAll("$1 $2"); - } - } catch (Throwable t) { - } htmlPane.setText(sText); srcPane.setText(htmlPane.getText()); --- 2222,2225 ---- |