I have to pass a string (input) in GET parameter of a URL, but there is a limit on maximum length of URL being 357.
The string is to be encoded using "Shift-JIS". For a keyword "blah 123 blahblah 321", i need to strip off last word(s) such that the string would be meaningful and the resulting URL length should be within the limit of 357.
But after converting into Shift-JIS encoding, I can no longer split string meaningfully. Converting back-n-forth would be suboptimal.
Can someone he开发者_StackOverflow社区lp here please. Thanks Nayn
My bad. This was easy.
I stripped off the encoded string on encoded delimiter. ex. For stripping off on " ", I stripped the string on URLEncoder.encode(" ", "Shift-JIS") Thanks Nayn
精彩评论