From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: eww doesn't decode %AA%BB%CC URL names Date: Thu, 24 Dec 2015 23:11:20 +0200 Message-ID: <83h9j7mu13.fsf@gnu.org> References: <83r3n0llkt.fsf@gnu.org> <87vb7nsq1g.fsf@gnus.org> <83ziwzmzyp.fsf@gnu.org> <8760znslig.fsf@gnus.org> <83twn7myin.fsf@gnu.org> <87bn9fr59a.fsf@gnus.org> <87vb7npogq.fsf@gnus.org> <87k2o3pnhz.fsf@gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1450991455 7426 80.91.229.3 (24 Dec 2015 21:10:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Dec 2015 21:10:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 24 22:10:50 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aCD9t-0003Md-GK for ged-emacs-devel@m.gmane.org; Thu, 24 Dec 2015 22:10:49 +0100 Original-Received: from localhost ([::1]:33431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCD9s-0002E0-J0 for ged-emacs-devel@m.gmane.org; Thu, 24 Dec 2015 16:10:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCD9o-0002Di-Aw for emacs-devel@gnu.org; Thu, 24 Dec 2015 16:10:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCD9j-0001OP-MU for emacs-devel@gnu.org; Thu, 24 Dec 2015 16:10:44 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCD9j-0001OL-J9; Thu, 24 Dec 2015 16:10:39 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3254 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aCD9j-0003sV-0X; Thu, 24 Dec 2015 16:10:39 -0500 In-reply-to: <87k2o3pnhz.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 24 Dec 2015 22:04:08 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:196803 Archived-At: > From: Lars Ingebrigtsen > Date: Thu, 24 Dec 2015 22:04:08 +0100 > > After spelunking down into `set-language-environment', it seems like > it's the setting of `default-file-name-coding-system' that's the problem > here: > > (encode-coding-string > (decode-coding-string > (url-unhex-string "%D0%A1%D0%B5%D1%80%D0%B4%D1%86%D0%B5") > 'utf-8) > default-file-name-coding-system) > => " " > > So I guess the file name should remain those percentages if it can't be > encoded using that... but how do I check that, then? :-) If you want to check that STRING can be encoded in CODING, do this: (member CODING (find-coding-systems-string STRING)) and see if the result is non-nil. For file names, you should do this test with file-name-coding-system, if that's non-nil, else with default-file-name-coding-system. > Charsets are hard! Subtle.