From 99a262b7309b6b291820168df7da1b3689382254 Mon Sep 17 00:00:00 2001
From: Brennan Ashton <bashton@brennanashton.com>
Date: Tue, 30 Oct 2018 14:09:07 -0700
Subject: docs: Properly excape backslashes in swig docstrings

Fixes #2097
---
 docs/doxygen/swig_doc.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'docs/doxygen/swig_doc.py')

diff --git a/docs/doxygen/swig_doc.py b/docs/doxygen/swig_doc.py
index 307920d776..6b74c0155f 100644
--- a/docs/doxygen/swig_doc.py
+++ b/docs/doxygen/swig_doc.py
@@ -80,11 +80,13 @@ class Block2(object):
 
 def utoascii(text):
     """
-    Convert unicode text into ascii and escape quotes.
+    Convert unicode text into ascii and escape quotes and backslashes.
     """
     if text is None:
         return ''
     out = text.encode('ascii', 'replace')
+    # swig will require us to replace blackslash with 4 backslashes
+    out = out.replace(b'\\', b'\\\\\\\\')
     out = out.replace(b'"', b'\\"').decode('ascii')
     return str(out)
 
-- 
cgit v1.2.3