encodeURIComponent behaves differently in browsers for china as location
Asked Answered
C

0

4

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..

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="Content-Language" content="zh-CN" />

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..

Chimney answered 10/10, 2011 at 16:35 Comment(1)
How is searchedKeywords initialized? Where do the values come from?Perplexed

© 2022 - 2024 — McMap. All rights reserved.