pgadmin4/web/pgadmin/utils/html.py
Ashesh Vashi 8bd17cb433 [Python 3 compatibility] Introduced a separate HTML safe string function
in 'utils' module, earlier the function -'escape(...)' was converting
the strings to bytes, and that's reason, it was not working on Python 3.
2016-05-16 11:58:42 +05:30

19 lines
443 B
Python

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2016, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
#########################################################################
"""Utilities for HTML"""
import cgi
def safe_str(x):
return cgi.escape(x).encode(
'ascii', 'xmlcharrefreplace'
).decode()