diff --git a/scss/cssdefs.py b/scss/cssdefs.py index 79be7b4b..6b4f5b7c 100644 --- a/scss/cssdefs.py +++ b/scss/cssdefs.py @@ -449,7 +449,11 @@ def determine_encoding(buf): def _unescape_one(match): if match.group(1) is not None: - return six.unichr(int(match.group(1), 16)) + try: + return six.unichr(int(match.group(1), 16)) + except ValueError: + return (r'\U%08x' % int(match.group(1), 16)).decode( + 'unicode-escape') elif match.group(2) is not None: return match.group(2) else: