Google CSE:当我搜索“é”等特殊字符时会中断

时间:2014-12-05 22:08:33

标签: html html-form google-custom-search

我们已经在我们的网站上安装了自定义搜索引擎 它工作正常,直到我们尝试用强调的字母搜索 由于网站是法语,有点需要工作......

如果我搜索:
“poupee” - 工作正常 “poupee!” - 工作正常 “poupée” - 不起作用。在谷歌搜索的实际调用甚至没有被称为

你可以在这里测试一下:
poupée - 不起作用:
http://www.ckoi.com/recherche.php?q=poup%E9e&sa=&cx=012997159615660210985%3Ask7xitg5ylq&cof=FORID%3A11&ie=ISO-8859-15&oe=ISO-8859-1&siteurl=www.ckoi.com%2F&ref=&ss=1994j797008j8

poupee - 作品:
http://www.ckoi.com/recherche.php?q=poupee&sa=&cx=012997159615660210985%3Ask7xitg5ylq&cof=FORID%3A11&ie=ISO-8859-15&oe=ISO-8859-1&siteurl=www.ckoi.com%2F&ref=&ss=776j143854j6

poupee! - 工作:
http://www.ckoi.com/recherche.php?q=poupee!&sa=&cx=012997159615660210985%3Ask7xitg5ylq&cof=FORID%3A11&ie=ISO-8859-15&oe=ISO-8859-1&siteurl=www.ckoi.com%2F&ref=&ss=2272j1680258j8

自定义引擎已设置为法语。

-----编辑: 这是html表单,我切换回ISO-8859-1(我网站的编码)

<div class="search-form">           
    <form class="search-wrapper cf" action="/recherche.php" id="cse-search-box">
        <input type="text" placeholder="Rechercher des extraits audio, articles..." name="q" />
        <button type="submit" class="search-button" name="sa"><i class="icon ion-search"></i></button>
        <input type="hidden" name="cx" value="012997159615660210985:sk7xitg5ylq" />
        <input type="hidden" name="cof" value="FORID:11" />
        <input type="hidden" name="ie" value="ISO-8859-1" original_value="ISO-8859-1" /> <!--value="ISO-8859-15"-->
        <input type="hidden" name="oe" value="ISO-8859-1" original_value="ISO-8859-1" /><!--value="ISO-8859-1"-->
    </form>
    <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=fr"></script>
</div>

任何人都知道我需要做什么?

1 个答案:

答案 0 :(得分:1)

我只想定义那个应该正常工作的表单(accept-charset="utf-8")的编码。

<div class="search-form">           
    <form class="search-wrapper cf" action="/recherche.php" id="cse-search-box" accept-charset="utf-8">
        <input type="text" placeholder="Rechercher des extraits audio, articles..." name="q" />
        <button type="submit" class="search-button" name="sa"><i class="icon ion-search"></i></button>
        <input type="hidden" name="cx" value="012997159615660210985:sk7xitg5ylq" />
        <input type="hidden" name="cof" value="FORID:11" />
        <input type="hidden" name="ie" value="utf-8" />
        <input type="hidden" name="oe" value="utf-8" />
    </form>
    <script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=fr"></script>
</div>

有了这个jsfiddle,你可以现场查看:http://jsfiddle.net/129d21nv/

然而,在该网站上,您仍然存在编码问题,但这是恕我直言,这是一个不同的问题。

相关问题