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 1laK5B-0002tL-CN for pgsql-admin@arkaria.postgresql.org; Sat, 24 Apr 2021 15:20:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1laK5A-0005MU-BE for pgsql-admin@arkaria.postgresql.org; Sat, 24 Apr 2021 15:20:32 +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 1laK5A-0005MN-3g for pgsql-admin@lists.postgresql.org; Sat, 24 Apr 2021 15:20:32 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1laK57-0002X4-TH for pgsql-admin@lists.postgresql.org; Sat, 24 Apr 2021 15:20:30 +0000 Received: by mail-qk1-x730.google.com with SMTP id 66so12949987qkf.2 for ; Sat, 24 Apr 2021 08:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=c+FsbRXpZdichTSFxX7OdZgHgC9GZQB8zuhFTwMUJZ0=; b=SMwWMK21lHGQCapfVq1Gnqyx0RrvonvCU6Crxa19SnPFrP19LQCEYVFZLE1oZxErKH xDgcuw4rTNwLn6uRQj0+qtn5u9MaoQXE0zwEBRIshjz0GFV3qBFGhjIk6O0Pvyq8bCAP LECMg9Pu6X1vutFWxrEABSuK6H5McnBgQYFSXdtSodVtEqdZxKhVDEle9T1B6wAUyeKa eNy93i/0ULf2C4VJ1IrSDj6/K09zG/IXNCSC+mcLCGF/FtUnkLjET3mfjJJ8HlDBRk5E 2wpw84JIXw9pO6JTsKJZHxUfCadBY7XDhC6ObWHLehGsF9TsxPXCvcKE2fKzLsm9VFAU FERg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=c+FsbRXpZdichTSFxX7OdZgHgC9GZQB8zuhFTwMUJZ0=; b=RRhw6ClM69G0PdQf0fFSi9W8ClHMzxxgq5hZ82j41MtgGdtCXaPKmgnZ2k8iDsYo04 SB3z5+WQ/xw1O5SSyyv6j12AmZspd/JOYvLcTo/MwYQnp6HbYHrgyTZfHZi9j1ZiS1pm 6i0CQBsYIS5LlNWPsutdstYq/4Js+LbSojWoHcGkYHnHzx/PGU9gd3ls28dMbhlJLXlP awL1kCVolSURVB6Zormrq0+QbmqFc08HCS6oWNhdKnH/SdrxGl6tlOBmgX47qWsdUxvk rd5XWoH0WXU/S+dbx9U3oHuJ4y4wtdte7MCgbFf7GUXZc5PSUg9oynnRHk5Oe93wq8gc KiaA== X-Gm-Message-State: AOAM533yOlMyk3SVMDtnOOep/FK4tPCFU1j4dJXFd25BPhlzemGvyy6Q AnRnabvcZgAKbu7QPYI5RBJ9EFwU8XBFzA== X-Google-Smtp-Source: ABdhPJx6TPlFSSzPQNayp3BrKm9Q6aXw4gG5Z7NKcHm7YXWPdOnpYnEfuKX/p5MM4eV4UvwQJ1T9lQ== X-Received: by 2002:a05:620a:110f:: with SMTP id o15mr9145650qkk.305.1619277627758; Sat, 24 Apr 2021 08:20:27 -0700 (PDT) Received: from [10.4.4.246] ([191.255.221.248]) by smtp.gmail.com with ESMTPSA id r5sm6232289qtp.75.2021.04.24.08.20.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Apr 2021 08:20:27 -0700 (PDT) From: Jorge Silva Content-Type: multipart/alternative; boundary="Apple-Mail=_66C0A95E-D976-4E5C-86F2-103F88DA51B1" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: xPath in a database with LATIN1 encoding Message-Id: Date: Sat, 24 Apr 2021 12:20:24 -0300 To: Pgsql-admin X-Mailer: Apple Mail (2.3654.60.0.2.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_66C0A95E-D976-4E5C-86F2-103F88DA51B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear all, We have a database, which is encoded with LATIN1, and we are adding some = tables in it to store xml files with the =E2=80=9Cxml=E2=80=9D type. = After creating the table and populating it, we use the xPath function to = retrieve some data from the XML, but it seems to not work properly, = because it returns:=20 ERROR: could not parse XML document DETAIL: line 1: Input is not proper UTF-8, indicate encoding ! Bytes: 0xE7 0xE3 0x6F 0x20 = 50550001974291546464219">3154646421Venda= produ 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 = differently 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?=20 Thanks in advance. Regards, Jorge Luiz Moreira Silva Polimet Ind=C3=BAstria Metal=C3=BArgica EIRELI --Apple-Mail=_66C0A95E-D976-4E5C-86F2-103F88DA51B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = all,

We have a = database, which is encoded with LATIN1, and we are adding some tables in = it to store xml files with the =E2=80=9Cxml=E2=80=9D type. After = creating the table and populating it, we use the xPath function to = retrieve some data from the XML, but it seems to not work properly, = because it returns: 
 ERROR:  could not parse XML = document
DETAIL:  line 1: Input is not proper UTF-8, indicate = encoding !
Bytes: 0xE7 0xE3 0x6F 0x20
50550001974291546464219"><ide><cUF>31</cUF>= ;<cNF>54646421</cNF><natOp>Venda = produ

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 differently 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? 

Thanks in advance.

Regards,

Jorge Luiz Moreira Silva
Polimet Ind=C3=BAstria Metal=C3=BArgica = EIRELI

= --Apple-Mail=_66C0A95E-D976-4E5C-86F2-103F88DA51B1--