5b18f0b·Author: John Marsden·Closed by: John Marsden·2012-03-16
Description
Hi John,
I found that jsonij wasn't able to parse some of my data that had URL-encoded characters. The string was getting passed into a String.format call in StringImp.java. String.format thought the URL-encoded character was a printf-style formatting code, but it wasn't a valid one, so it threw java.util.UnknownFormatConversionException.
To fix this, I removed the String.format call. The String.format call was only passing the source string, with no additional arguments for substitution, so I think this call was a no-op anyway. (Let me know if I'm missing something.)
I enhanced the unit tests to try a string with URL-encoded characters too. The new tests failed until I made the code fix. All tests pass now.
Hi John,
I found that jsonij wasn't able to parse some of my data that had URL-encoded characters. The string was getting passed into a String.format call in StringImp.java. String.format thought the URL-encoded character was a printf-style formatting code, but it wasn't a valid one, so it threw java.util.UnknownFormatConversionException.
To fix this, I removed the String.format call. The String.format call was only passing the source string, with no additional arguments for substitution, so I think this call was a no-op anyway. (Let me know if I'm missing something.)
I enhanced the unit tests to try a string with URL-encoded characters too. The new tests failed until I made the code fix. All tests pass now.
Thanks, --Chris