Yesterday using SDK I created a webservice(URL) for a CRM Entity-Lead creation. I was calling my webservice through JScript [using window.open()] with the parameterized value QueryString.
I’ll be taking a test scenario of URL here.
My URL was like(example):
The values being passed in my QueryString were in Unicode Characters. But I was very surprised to see the result when I hit the URL in my IE Browser(Ver.8).
The resultant URL was following and consequently lead was created with values “???” instead of unicode characters:
When I hit the same URL in Chrome and Firefox the result was following and consequently lead was created with correct Unicode values:
It simply meant that the IE browser was unable to encode the Unicode correctly, which resulted in replacing the Unicode values with “?” values.
I had no options left but to Encode my URL since client was only using IE as their default browser. So to follow up with Encoding I found a very Helpful site which gives you Multiple Options to view and analyze your Encoded URL.
Mostly for Encoding purpose we use following Two options:
- encodeURI :- Encodes a text string as a valid Uniform Resource Identifier (URI).
- encodeURIComponent :- In addition to encodeURI, it encodes the following characters as well: , / ? : @ & = + $ #
The encodeURI function suited my requirement criteria and I was able to call my webservice in JScript IE browser using:
which ultimately resulted in creation of leads with Correct Unicode Values.
Hope this little information was helpful.