Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrjb0-0006BK-Ho for pgsql-novice@arkaria.postgresql.org; Thu, 19 May 2022 17:05:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nrjay-0005Wy-Ks for pgsql-novice@arkaria.postgresql.org; Thu, 19 May 2022 17:05:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrjax-0005Wn-JO for pgsql-novice@lists.postgresql.org; Thu, 19 May 2022 17:05:52 +0000 Received: from outbound2o.ore.mailhop.org ([54.187.213.119]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrjaq-0001o4-UX for pgsql-novice@lists.postgresql.org; Thu, 19 May 2022 17:05:50 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1652979944; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=jnd12FmAb+KyeVXOpmERaON6IzFkAAd0m+dZY6x9iJdlX7K3YALKqr0P+dY6w6gAOGLRLZmLJM9gt ZaDvHDSfphBz9LRpQMzMUhF6CO8kozAxg1LDni5OwtQ3HSVnPPvDeR/07VXnEB2QaIRE9LGG/sNP85 AMm0Y1/s7DVenVRel4ZXnZzSVqpX7Kspy+JtHtEKOUOQedqu6noNH8/QRpooruDdmm8r+E/6FVtr1G 1xZ/+5mJhHHHj4phmjQPAgjmi/NR0GUPXX4kNe6o+80pnsDM4ahqi8M3y17fAGFCt4X/e16KI0IM14 y0W8nQLSLQB+o5+85OkAZ6hNFe3cRAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=mime-version:content-type:references:in-reply-to:date:to:from:subject: message-id:dkim-signature:dkim-signature:dkim-signature:from; bh=xUKBwwvYK6DJB6OupiW9+5QV6LO17XKXL4EVyBkssp0=; b=F+KlyEZfpFgKS1Y0CVlTi5dmVcbumdqdTR0UfihwmisLUpAiGUVpdmA6q8TF19rb1Q1qi3O53wuGh ujg9tj6VJEBlsvFAm9LrkzDbQsTtrLbHYbSeyB2pu1q8m2F7Et2v3/qT+L6WtMc1emVEnaqczA8JbG kxtL+4sJqRse74B1++zdgfAn7dg7V4cUWAyxIcJRY1VMxYMxTYubR1LbOaoQSCsRcEELMhZFZrM3ho Y3V2uOMmfE0n6weWrGI8GckXVX0pag0NVw19QbrUr8LHOWDPONop5oLZFVOtjtlFZbtbX2AbCZY/M3 DCYgE1idkj9pC2OSYWL6rnv3ZQtnn8Q== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=pass smtp.mailfrom=lists.simkin.ca smtp.remote-ip=172.105.109.24; dkim=pass header.d=lists.simkin.ca header.s=athena header.a=rsa-sha256 header.b=YM3d4HZ4; dmarc=pass header.from=lists.simkin.ca; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.simkin.ca; s=duo-1610662143981-d3c4c825; h=mime-version:content-type:references:in-reply-to:date:to:from:subject: message-id:from; bh=xUKBwwvYK6DJB6OupiW9+5QV6LO17XKXL4EVyBkssp0=; b=hakfo+QM/ikJpKdoNvZvv6iloNq3M0w0nhUEX6Q5oZ3/3xTJuiwcKBya8igsUKA9Ax4dhup6bzu2x SL2u+CzaQy3tjvG99O6gCu6rYPzv5M3o9Tg/ZXgMxBH7zcTAgCw/7xNxfVJHiik10PMZVlXwVxQOqe LV6EdaLx1Y0hFqRo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=mime-version:content-type:references:in-reply-to:date:to:from:subject: message-id:from; bh=xUKBwwvYK6DJB6OupiW9+5QV6LO17XKXL4EVyBkssp0=; b=hPImcKJNJP1PAvu/GmC0lKzMRhthmj9kPVLca+xtnQO+Zw5XIwaaTszK14U7W3LUOWvxbB0G2BgW0 rKm3MWbaIk2Wq87/GmGHwA7C+oRvr4l+bB9IL5wojlCyE7QT67encqkPh/p/GTC+wfADyGh0StPtm1 WDv7QzQCuJiUENLLQ6/FOw+BHUakg0Le1l7EeuNNSaoNxmTEb8wGertO706pfly95oCLfgBeTgV0Jy EjaRuWk8Zyl78ohuXCo3eYFC2k5mkDHiL+z7Q+a25oRti2xoE6InbnxyhcdenLlcU9Iy4LqQe5Mn2Z 1VBFaWn0lIg+C6cNzdXfWYikwaVZLjA== X-Originating-IP: 172.105.109.24 X-MHO-RoutePath: c2lta2lu X-MHO-User: e962fdb8-d795-11ec-9e7d-95702c074b68 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from athena.simkin.ca (athena.simkin.ca [172.105.109.24]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id e962fdb8-d795-11ec-9e7d-95702c074b68; Thu, 19 May 2022 17:05:42 +0000 (UTC) Received: from skynet.simkin.ca (node-1w7jr9sr73xr4ze19xwgjcteu.ipv6.telus.net [IPv6:2001:569:bce0:6400:fa75:a4ff:fe2f:92e6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by athena.simkin.ca (Postfix) with ESMTPSA id E7B9BC6BB7CD for ; Thu, 19 May 2022 10:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.simkin.ca; s=athena; t=1652979939; bh=9b6cbrrttWwnGnlf6yxtAycUHL3z95ncDMOYRBwsgqc=; h=Subject:From:To:Date:From:To:Subject:Date:Reply-To; b=YM3d4HZ45mVVgQxGSEk+F+qm8DOX3tRsHOz3xfCZTQdA3DTh8s1mxHL2CF1uh2uT2 YIsdZ/PnRHODGj935GaIScvi+gzXr7+hQ48JxiVkd2Y58rNqthniPCw9o9UfESz6Bs uT8ldwtxWTGk/GgMU5JFdipgSXGs11z6eFuHrgZRd4ALjnwcNoP3ffm8p66lE2G1x3 AsVZFQCGdIOu0bEQEfBL1S9NsL5ltbIOptMMi6SNwkm7PshU0gaqu67YWX0Vlpb9ay gdzWVv+jqExum5tlUvTiRWBOaz30a8BskaaxRpM6CS8LcoUqyX90MMjEsnpHzXa76T diym222hYOvCw== Received: from skynet.simkin.ca (skynet.simkin.ca [IPv6:::1]) by skynet.simkin.ca (Postfix) with ESMTP id A83B4105AD251 for ; Thu, 19 May 2022 10:05:36 -0700 (PDT) Message-ID: Subject: Re: Comparing two URL strings From: Alan Hodgson To: pgsql-novice@lists.postgresql.org Date: Thu, 19 May 2022 10:05:36 -0700 In-Reply-To: References: Content-Type: multipart/alternative; boundary="=-/fdxOPxHvfvp3nGcwXgT" X-PGP-Key: fp="EF82 6F8D A3BA A096 FFA3 05F2 A7A0 40A5 34E5 AA0B"; id="0x34E5AA0B"; get= User-Agent: Evolution 3.42.4 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-/fdxOPxHvfvp3nGcwXgT Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 8bit On Thu, 2022-05-19 at 22:23 +0530, mahendrakar s wrote: > Hi, > I am facing an issue in comparing two urls (below). > 1)  "https://domain.org/v1.0/users/test@user.org" > 2)   "https://domain.org/v1.0/users/test%40user.org" > > Comparison of the two strings is failing due to mismatch of '%40'  > and (@) character even though the both urls are the same. >  (gdb) p url > $1 = 0x55d35cfbd1f8 "https://domain.org/v1.0/users/test@user.org" > (gdb) p graph_url > $2 = 0x7ffd82777240 "https://domain.org/v1.0/users/test%40user.org" > > Can you please let me know how to compare these two strings. > One way I could think of is convert both the strings to utf-8 but > don't find an utility function to compare the UTF-8 strings. > They aren't multi-byte; converting them to UTF-8 wouldn't change anything. As is, they are in fact different strings, as "URL" is something only browsers know about. You probably need to urldecode (or encode) them in your programming language before storing them. --=-/fdxOPxHvfvp3nGcwXgT Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
On Thu, 2022-05-19 at 22:23 +0530, mahendraka= r s wrote:
Hi,
I= am facing an issue in comparing two urls (below).

Comparison of the two strings is failing due&n= bsp;to mismatch of '%40'  and (@) character even though the both urls = are the same.
 (gdb) p url
$1 =3D 0x55d35cfbd1f8 "https://domain.org/v1.0/users/tes= t@user.org"
(gdb) p graph_url
$2 =3D 0x7ffd82777240 "https://domain.org/v1.0/users= /test%40user.org"

Can you please let= me know how to compare these two strings.
One way I could t= hink of is convert both the strings to utf-8 but don't find an utility func= tion to compare the UTF-8 strings.

<= div>
They aren't multi-byte; converting them to UTF-8 wouldn'= t change anything. As is, they are in fact different strings, as "URL" is s= omething only browsers know about.

You probably ne= ed to urldecode (or encode) them in your programming language before storin= g them.
--=-/fdxOPxHvfvp3nGcwXgT--