From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Xu Newsgroups: gmane.emacs.help Subject: Re: Eww can't display Chinese characters correctly. Date: Sat, 19 Dec 2020 19:27:00 +0100 Organization: the Church of Emacs Message-ID: References: <87sg88xza8.fsf@codeisgreat.org> <87tuso30wh.fsf@gnus.org> <87lfe0307l.fsf@gnus.org> <877dpk2ysn.fsf@gnus.org> <87r1nlj03c.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33783"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:enWZJ14QZKiNw1UD9+EWojGtypw= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 19 19:27:39 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqgx9-0008i6-Qa for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 19:27:39 +0100 Original-Received: from localhost ([::1]:41274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqgx8-0005r5-Sk for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 13:27:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqgwh-0005qy-Jm for help-gnu-emacs@gnu.org; Sat, 19 Dec 2020 13:27:11 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:59128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqgwf-0001Pg-IN for help-gnu-emacs@gnu.org; Sat, 19 Dec 2020 13:27:10 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kqgwc-00086Z-G5 for help-gnu-emacs@gnu.org; Sat, 19 Dec 2020 19:27:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126581 Archived-At: Lars Ingebrigtsen writes: > William Xu writes: > > Yes, Google serves out HTML that actually works if the User-Agent > indicates the major browsers. If you > > (setq url-user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) > AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 > Safari/537.36") > > that makes Google serve out HTML that's non-buggy. Thanks, this works for me too. I guess I should add this to my .emacs. :) >> Also, if i copy and paste below url directly in safari or chrome, it >> would display the page correctly. >> >> http://www.google.com/search?gbv=1&iflsig=AINFCbYAAAAAX9eJ576dBCkZ_8MT30T-VWnLwzH6yNx4&bih=&biw=&source=hp&hl=no&ie=ISO-8859-1&btnG=Google-s%C3%B8k&q=+%E4%B8%AD%E6%96%87%E7%BD%91 >> >> On the other hand, when I just mouse-click from emacs, which calls >> browse-url, then safari will display the same garbage there, simlar to >> what OP posts. > > I see the same in Chrome whether I go via browse-url or paste the URL. I look into the browse-url implementation, if I call the same command line ("open URL"), the same garbage will be shown in Safari. So it is something happening in the Safari. Somehow when it is pasted in the address bar Safari, it has converted the pasted url into below: https://www.google.com/search?client=safari&rls=en&q=%E4%B8%AD%E6%96%87%E7%BD%91&ie=UTF-8&oe=UTF-8 The same trick doesn't work for Chrome. -- William