summaryrefslogtreecommitdiff
path: root/pygments/util.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-05-16 17:52:34 -0700
committerTim Hatch <tim@timhatch.com>2014-05-16 17:52:34 -0700
commit778edd1d5ff974b1d4084af964151d9f87f05efd (patch)
treee92c418a1396733ee5fd92b4ece42314b47be431 /pygments/util.py
parent97422c5ed7200eeb588cf07f3e63cd1a80016f15 (diff)
parent6a2d5f2126349eefac049953a410ffa8f3458c05 (diff)
downloadpygments-778edd1d5ff974b1d4084af964151d9f87f05efd.tar.gz
Merged in jambonrose/pygments-main (pull request #338)
Produce only unicode escape sequences in RTFs
Diffstat (limited to 'pygments/util.py')
-rw-r--r--pygments/util.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pygments/util.py b/pygments/util.py
index c302900f..5dc6981f 100644
--- a/pygments/util.py
+++ b/pygments/util.py
@@ -208,6 +208,11 @@ def looks_like_xml(text):
# Python narrow build compatibility
def _surrogatepair(c):
+ # Given a unicode character code
+ # with length greater than 16 bits,
+ # return the two 16 bit surrogate pair.
+ # From example D28 of:
+ # http://www.unicode.org/book/ch03.pdf
return (0xd7c0 + (c >> 10), (0xdc00 + (c & 0x3ff)))
def unirange(a, b):