From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: How to escape a string which will be added as a ?key=value parameter in a url? Date: Mon, 28 Sep 2015 06:45:49 +0600 Message-ID: References: <87mvw7r5xo.fsf@mbork.pl> <87fv1zipgh.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1443401185 12098 80.91.229.3 (28 Sep 2015 00:46:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Sep 2015 00:46:25 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 28 02:46:25 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ZgMaG-0000sD-Dx for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Sep 2015 02:46:24 +0200 Original-Received: from localhost ([::1]:59597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgMaF-00016W-6m for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Sep 2015 20:46:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgMa3-00016G-4k for help-gnu-emacs@gnu.org; Sun, 27 Sep 2015 20:46:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgMa2-0008Om-64 for help-gnu-emacs@gnu.org; Sun, 27 Sep 2015 20:46:11 -0400 Original-Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:34322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgMa1-0008OV-V8 for help-gnu-emacs@gnu.org; Sun, 27 Sep 2015 20:46:10 -0400 Original-Received: by lacmq5 with SMTP id mq5so187346lac.1 for ; Sun, 27 Sep 2015 17:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=hjN70izNXFyzojm90MP2xO0FsRg7Bu6oaYYIO2Gx7CA=; b=jflz2BnRjE3HIJkin1EOpPBRD3FnLxvlhSP4+7VGhyfbtizyl5AeFI+IWQQYhIlxYi CGM2/TkzNPWaKqdmKImxTED+6M0iIrrtFVUjAJCiRKUvNBAWFS3KEoFOtO/FwjU8CXJn qBiloEyL9O+gLzARX/l5VqKOwVmsYC0GvKcC0+xXBing+qCWMLmdrYEO3W0t0njgsXYW 0XX3JAN1wv/YwlS2kN2SoXyoMqeh1wblN2LVQLp5Q5WwuIDQawiYaxfXqz1DI792X2B6 oa+I8o3KGqff+pR3uL7VBNapM659k4qK7GfxD+X74vrOapTK1SAhzplJqRTmWgCUxFpt n3xA== X-Received: by 10.152.198.230 with SMTP id jf6mr3375059lac.13.1443401168673; Sun, 27 Sep 2015 17:46:08 -0700 (PDT) Original-Received: by 10.25.156.131 with HTTP; Sun, 27 Sep 2015 17:45:49 -0700 (PDT) In-Reply-To: <87fv1zipgh.fsf@web.de> X-Google-Sender-Auth: PV-jgoiX1cyuRRPuV9j2QGGHxvw X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::229 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107386 Archived-At: On Mon, Sep 28, 2015 at 2:20 AM, Michael Heerdegen wrote: > Marcin Borkowski writes: > >> I have a bunch of keys and values, and I want to construct a url with >> a ?key=value&key2=value2 syntax. Is there a function which would >> properly escape characters like ?, =, & for that? > > Maybe `url-hexify-string'? More like url-build-query-string. Blindly substituting the value for %s in a format string, as Emanuel suggests, is definitely not the right thing.