dcsimg
encodeURIComponent behaves differently in browsers for china as location
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   frozen_e4
Posted On:   Tuesday, October 11, 2011 04:29 AM

i have an interesting problem in hand that involves chinese.. i use google custom search and append searched keywords as below.. window.location="http://search.xyz.com/search/cn/zh"+"#"+encodeURIComponent(searchedKeywords); 1. results in chrome and internet explorer for 搜索 are proper but in firefox no results appear.. 2. in chrome and internet explorer, url created is http://search.xyz.com/search/cn/zh#%E6%90%9C%E7%B4%A2 3. in firefox, url created is http://search.xyz.com/search/cn/zh#%u641C%u7D22 4. in chrome and internet explorer, search box that appears in the result page has value æç´¢ 5. in firefox, search box t   More>>

i have an interesting problem in hand that involves chinese..



i use google custom search and append searched keywords as below..



window.location="http://search.xyz.com/search/cn/zh"+"#"+encodeURIComponent(searchedKeywords);



1. results in chrome and internet explorer for 搜索 are proper but in firefox no results appear..

2. in chrome and internet explorer, url created is http://search.xyz.com/search/cn/zh#%E6%90%9C%E7%B4%A2

3. in firefox, url created is http://search.xyz.com/search/cn/zh#%u641C%u7D22

4. in chrome and internet explorer, search box that appears in the result page has value æç´¢

5. in firefox, search box that appears in the result page has value 搜索

6. in all three browsers, if i search with any valid chinese words, no result appear..


i do include below elements in the file..











since the query is formed in the browser using script, my tomcat server is not involved, so we can rule that out..



now how do i show 搜索 in search box in result page of chrome and internet explorer and also achieve the search with valid chinese words..



highly appreciate your help..

   <<Less
About | Sitemap | Contact