From 85d716c5948a7be7cfbe59c96bc7ad2ed34226dd Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 5 Feb 2011 17:16:06 +0100 Subject: [PATCH] fix surrogate pair calculation --- Cython/Compiler/PyrexTypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 07142349..6ed25191 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -965,7 +965,7 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) { if (high_val >= 0xD800 && high_val <= 0xDBFF) { Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1]; if (low_val >= 0xDC00 && low_val <= 0xDFFF) { - return 0x10000 | ((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)); + return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1))); } } } -- 2.26.2