From ab0ee308818f8d04b8a2bb0d472334598265a004 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 16 Nov 2016 13:00:50 +0100 Subject: [PATCH] Support loading docs in utf-8 from pg version 10 --- tools/docs/docload.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/docs/docload.py b/tools/docs/docload.py index faf1892e..12b26957 100755 --- a/tools/docs/docload.py +++ b/tools/docs/docload.py @@ -29,7 +29,17 @@ def load_doc_file(filename, f): indent='auto', ) - contents = unicode(f.read(),'latin1') + # Postgres 10 started using xml toolchain and now produces docmentation in utf8. So we need + # to figure out which version it is. + rawcontents = f.read() + if rawcontents.startswith('