Originally Posted by
fishtoprecords
Why define it yourself? just use the URLencode/decode functions in the libraries?
I worked on this trying to achieve a way to manipulate or at least prove the string returned by lib method. That arrived at a string that prints a decoded string. Then to get all up to "/web-inf/" I attempted to write a regex - this time looking at the rfc to determine what characters to allow. I then did
/****** here we go... ******/
java.util.regex.Matcher d572b09 = pitterPatter.matcher(l1434be);
// If we captured state of where we are at ....
while(d572b09.find())
{
// StringBuffer.append(Matcher.group());//
ce79a43b0673a1.append(d572b09.group());
}
isValid=Boolean.valueOf(true);//
return ce79a43b0673a1.toString();//
- the returned string prints with the %20's still in it. I would think
Pattern.compile("file:( /|\\w|\\d|-|_|\\.|!|~|\\*|\'|\\(|\\))+WEB-INF/");//
would capture all up to the end of "WEB-INF/" on a decoded string - thus I could append a filename to that and achieve a file.open(StringBuffer.toString());
Just trying to get the Charset issue to work on the lib decode was an achievement, could not discover why and where
StringBuffer.append(d572b09.group());
would fail ( in the manner described ) .....
At a loss for words, do not know what to ask. I looked into all the db stuff, I will continue to work on using a db but I wish to write a file behind WEB-INF that I determine the syntax of and can make decisions such as using:
ASCII reserves the first 32 codes (numbers 0–31 decimal) for control characters: codes originally intended not to carry printable information, but rather to control devices (such as printers) that make use of ASCII, or to provide meta-information about data streams such as those stored on magnetic tape.
( source: Wiki ) or use some printable characters or just exactly what to do without being directed and determined by entities with ulterior interests.
EG: I do not see where the regex captures "%20" Even if we allow for ("\\d)+ in the regex it should not pick up "%" ~ at least not by common sense.