mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
add urlEncode() and urlDecode()
This commit is contained in:
@@ -25,6 +25,8 @@ package processing.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import android.content.*;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.AssetManager;
|
||||
@@ -34,6 +36,8 @@ import android.graphics.*;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.*;
|
||||
@@ -4825,6 +4829,29 @@ public class PApplet extends Activity implements PConstants, Runnable {
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// URL ENCODING
|
||||
|
||||
static public String urlEncode(String what) {
|
||||
try {
|
||||
return URLEncoder.encode(what, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) { // oh c'mon
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static public String urlDecode(String what) {
|
||||
try {
|
||||
return URLDecoder.decode(what, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) { // safe per the JDK source
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// SORT
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ X http://code.google.com/p/processing/issues/detail?id=769
|
||||
X /opt/android using version #s again? fix build script (earlier)
|
||||
X smooth() is now the default
|
||||
|
||||
_ don't let the ... ?
|
||||
_ lack of registerXxx() implementation is breaking pre() and post() in particles
|
||||
|
||||
_ focus handling note:
|
||||
_ http://android-developers.blogspot.com/2011/11/making-android-games-that-play-nice.html
|
||||
|
||||
@@ -6613,6 +6613,29 @@ public class PApplet extends Applet
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// URL ENCODING
|
||||
|
||||
static public String urlEncode(String what) {
|
||||
try {
|
||||
return URLEncoder.encode(what, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) { // oh c'mon
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static public String urlDecode(String what) {
|
||||
try {
|
||||
return URLDecoder.decode(what, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) { // safe per the JDK source
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// SORT
|
||||
|
||||
@@ -38,6 +38,7 @@ X http://code.google.com/p/processing/issues/detail?id=725
|
||||
X Closing applet window in Processing 1.5 causes serial crash
|
||||
X http://code.google.com/p/processing/issues/detail?id=635
|
||||
|
||||
_ "import processing.xml" throws a missing library error
|
||||
|
||||
_ renaming a normal tab to same name with ".java" fails with ".pde" version already exists
|
||||
_ http://code.google.com/p/processing/issues/detail?id=776
|
||||
|
||||
Reference in New Issue
Block a user