]> granicus.if.org Git - postgresql/commit
Ignore XML declaration in xpath_internal(), for UTF8 databases.
authorNoah Misch <noah@leadboat.com>
Sat, 11 Nov 2017 19:10:53 +0000 (11:10 -0800)
committerNoah Misch <noah@leadboat.com>
Sat, 11 Nov 2017 19:11:24 +0000 (11:11 -0800)
commit2f4061aff504049767602927e69c85b5b4621273
tree3eac87beb471b081274635258b8cf8a6c29f8296
parent0bcdab58e83b2ac2caf4bd78e1583c11df97d4f1
Ignore XML declaration in xpath_internal(), for UTF8 databases.

When a value contained an XML declaration naming some other encoding,
this function interpreted UTF8 bytes as the named encoding, yielding
mojibake.  xml_parse() already has similar logic.  This would be
necessary but not sufficient for non-UTF8 databases, so preserve
behavior there until the xpath facility can support such databases
comprehensively.  Back-patch to 9.3 (all supported versions).

Pavel Stehule and Noah Misch

Discussion: https://postgr.es/m/CAFj8pRC-dM=tT=QkGi+Achkm+gwPmjyOayGuUfXVumCxkDgYWg@mail.gmail.com
src/backend/utils/adt/xml.c
src/test/regress/expected/xml.out
src/test/regress/expected/xml_1.out
src/test/regress/expected/xml_2.out
src/test/regress/sql/xml.sql