JAL-860 fixed grammar for one structure vs many structures associated with selection
[jalview.git] / src / jalview / ws / rest / params / JobConstant.java
index fddfd3b..64bb45f 100644 (file)
@@ -6,6 +6,7 @@ import jalview.ws.rest.NoValidInputDataException;
 import jalview.ws.rest.RestJob;
 
 import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -49,7 +50,13 @@ public class JobConstant extends InputType
     
     if (value!=null && value.length()>0)
     {
-      prm.add(value);
+      try {
+        prm.add(URLEncoder.encode(value,"UTF-8"));
+      } catch (UnsupportedEncodingException ex)
+      {
+        throw new Error("Couldn't encode '"+value+"' as UTF-8.",ex);
+       
+      }
     }
     return prm;
   }