Changeset 33051 for main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java
- Timestamp:
- 2019-05-06T16:23:43+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java
r33046 r33051 20 20 import java.io.InputStream; 21 21 import java.io.IOException; 22 //import java.io.UnsupportedEncodingException;23 //import java.net.URLEncoder;24 //import java.nio.charset.StandardCharsets;25 22 import java.util.ArrayList; 26 23 import java.util.Vector; … … 334 331 // http://www.cgi101.com/class/ch3/text.html 335 332 336 // And need to ensure that special characters won't get clobbered on Windows by perl/CGI.pm (https://www.nntp.perl.org/group/perl.perl5.porters/2016/10/msg240120.html), 337 // URL encode the query_string, as at https://stackoverflow.com/questions/10786042/java-url-encoding-of-query-string-parameters 338 339 // perl/CGI.pm doesn't like us URL encoding the entire query string such as the equal sign between each paramName and paramValue. 340 // So we URL encode each paramValue separately, which is done in GS2Construct.java::runCommand() 341 /* 342 String old_query_string = this.query_string; 343 try{ 344 this.query_string = URLEncoder.encode(this.query_string, StandardCharsets.UTF_8.name()); 345 //this.query_string = this.query_string.replace("+","%2B"); // https://stackoverflow.com/questions/1211229/in-a-url-should-spaces-be-encoded-using-20-or 346 } catch(UnsupportedEncodingException uee) { 347 logger.warn("**** Unable to encode query_string in UTF-8, so attempting to continue with the unencoded value of query_string"); 348 this.query_string = old_query_string; 349 } 350 */ 333 // And since we need to ensure that special characters won't get clobbered on Windows by perl/CGI.pm 334 // (see https://www.nntp.perl.org/group/perl.perl5.porters/2016/10/msg240120.html), 335 // each param *value* in QUERY_STRING, not QUERY_STRING in entirety, is further URL encoded, 336 // as at https://stackoverflow.com/questions/10786042/java-url-encoding-of-query-string-parameters 337 // This URL encoding of paramValues already happened in GS2Construct.java::runCommand(), so QUERY_STRING is ready now. 351 338 352 339 String[] envvars = {
Note:
See TracChangeset
for help on using the changeset viewer.