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 1laLTG-0005Z4-IH for pgsql-admin@arkaria.postgresql.org; Sat, 24 Apr 2021 16:49:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1laLTF-0003BW-GH for pgsql-admin@arkaria.postgresql.org; Sat, 24 Apr 2021 16:49:29 +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 1laLTF-0003BP-97 for pgsql-admin@lists.postgresql.org; Sat, 24 Apr 2021 16:49:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1laLT9-0003Yb-Gk for pgsql-admin@lists.postgresql.org; Sat, 24 Apr 2021 16:49:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13OGnL0s1707308; Sat, 24 Apr 2021 12:49:21 -0400 From: Tom Lane To: Jorge Silva cc: Pgsql-admin Subject: Re: xPath in a database with LATIN1 encoding In-reply-to: References: Comments: In-reply-to Jorge Silva message dated "Sat, 24 Apr 2021 12:20:24 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1707306.1619282961.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 24 Apr 2021 12:49:21 -0400 Message-ID: <1707307.1619282961@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jorge Silva writes: > The characters that it is not recognizing are both =E2=80=9C=C3=A7=E2=80= =9D and =E2=80=9C=C3=A3=E2=80=9D because I think they are encoded differen= tly in latin1 and utf-8. Is it possible to somehow use the xPath function = with special characters in the XML and in a database which is not encoded = with utf-8? = I don't have a lot of expertise in this area, but I think you need an explicit encoding indicator in the xml header, a la ... On the whole, the xml type is definitely easier to use with database encoding set to utf8. I think you'll be paying for encoding conversion every time we interact with libxml, for instance. regards, tom lane