From 3c891408eada15276c8e814a895275900bdfd1a1 Mon Sep 17 00:00:00 2001 From: rbuj Date: Wed, 23 Jul 2014 09:08:47 +0200 Subject: beanshell: encode(String) in URLEncoder has been deprecated http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLEncoder.html Change-Id: Ie21fdd12206c7954e99761826f98686c4567aa64 Reviewed-on: https://gerrit.libreoffice.org/10482 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist --- external/beanshell/bsh-2.0b1-src.patch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/external/beanshell/bsh-2.0b1-src.patch b/external/beanshell/bsh-2.0b1-src.patch index 786bc9b7c74e..6162e739d199 100644 --- a/external/beanshell/bsh-2.0b1-src.patch +++ b/external/beanshell/bsh-2.0b1-src.patch @@ -116,3 +116,31 @@ win.toFront(); splashScreen = win; } +--- misc/BeanShell/src/bsh/Remote.java 2003-12-19 17:14:29.000000000 +0100 ++++ misc/build/BeanShell/src/bsh/Remote.java 2014-07-23 08:52:39.000000000 +0200 +@@ -137,13 +137,14 @@ + static String doHttp( String postURL, String text ) + { + String returnValue = null; ++ ++ try { + StringBuffer sb = new StringBuffer(); + sb.append( "bsh.client=Remote" ); + sb.append( "&bsh.script=" ); +- sb.append( URLEncoder.encode( text ) ); ++ sb.append( URLEncoder.encode(text,"UTF-8") ); + String formData = sb.toString( ); + +- try { + URL url = new URL( postURL ); + HttpURLConnection urlcon = + (HttpURLConnection) url.openConnection( ); +@@ -172,6 +173,8 @@ + + System.out.println( "Return Value: "+returnValue ); + ++ } catch (UnsupportedEncodingException e) { ++ System.out.println(e); // bad character encoding + } catch (MalformedURLException e) { + System.out.println(e); // bad postURL + } catch (IOException e2) { -- cgit