Kaydet (Commit) 3c891408 authored tarafından rbuj's avatar rbuj Kaydeden (comit) Caolán McNamara

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/10482Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 37594357
...@@ -116,3 +116,31 @@ ...@@ -116,3 +116,31 @@
win.toFront(); win.toFront();
splashScreen = win; 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) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment