You should get:
Characters (like ' ' and ',') that are not allowed in URLs should be encoded as %xx, where xx are the character's code in hex.
I seem to remember that some devices behave oddly if you System.out.println() a string that contains the "%" character. So you might see strange output.
Thanks for checking this. I undid some changes made since I last editted it, but not others - some of the changes were good. Hopefully I got the right ones! As you correctly pointed out, there is no ArrayList class, and Character has no forDigit() method, in CLDC. Someone had changed the code and not checked it compiled properly!