tags:

views:

33

answers:

1

Hi, 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 help here please. Thanks Nayn

A: 

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

Nayn