Skip to content

Instantly share code, notes, and snippets.

@psftw
Created April 30, 2013 19:55
Show Gist options
  • Save psftw/5491435 to your computer and use it in GitHub Desktop.
Save psftw/5491435 to your computer and use it in GitHub Desktop.
java Properties escaping
$ jython
Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_38
Type "help", "copyright", "credits" or "license" for more information.
>>> test = "key=http\:\/\/example.com/?urlkey\=urlval"
>>> import java.util.Properties
>>> p = java.util.Properties()
>>> import java.io.StringReader
>>> sr = java.io.StringReader(test)
>>> p.load(sr)
>>> p
{key=http://example.com/?urlkey=urlval}
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment