From 0e19e76aba9f470c348e25bb2d550f9a096642bd Mon Sep 17 00:00:00 2001
From: Fredrik Lundh <fredrik@pythonware.com>
Date: Sun, 16 Jul 2000 18:47:43 +0000
Subject: - change \x to mean "byte" also in unicode literals   (patch #100912)

---
 Objects/unicodeobject.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 989ad1f..3542879 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1198,13 +1198,15 @@ PyObject *PyUnicode_DecodeUnicodeEscape(const char *s,
             *p++ = x;
             break;
 
-        /* \xXXXX escape with 0-4 hex digits */
+        /* \xXXXX escape with 1-n hex digits.  for compatibility
+           with 8-bit strings, this code ignores all but the last
+           two digits */
         case 'x':
             x = 0;
             c = (unsigned char)*s;
             if (isxdigit(c)) {
                 do {
-                    x = (x<<4) & ~0xF;
+                    x = (x<<4) & 0xF0;
                     if ('0' <= c && c <= '9')
                         x += c - '0';
                     else if ('a' <= c && c <= 'f')
@@ -1213,7 +1215,7 @@ PyObject *PyUnicode_DecodeUnicodeEscape(const char *s,
                         x += 10 + c - 'A';
                     c = (unsigned char)*++s;
                 } while (isxdigit(c));
-                *p++ = x;
+                *p++ = (unsigned char) x;
             } else {
                 *p++ = '\\';
                 *p++ = (unsigned char)s[-1];
-- 
cgit v0.12

h.patch'>log</a><a class='active' href='/oss-git/mxe.git/tree/src/qt-2-macosx-gcc-arch.patch?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>tree</a><a href='/oss-git/mxe.git/commit/src/qt-2-macosx-gcc-arch.patch?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>commit</a><a href='/oss-git/mxe.git/diff/src/qt-2-macosx-gcc-arch.patch?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>diff</a><a href='/oss-git/mxe.git/stats/src/qt-2-macosx-gcc-arch.patch'>stats</a></td><td class='form'><form class='right' method='get' action='/oss-git/mxe.git/log/src/qt-2-macosx-gcc-arch.patch'>
<input type='hidden' name='id' value='ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='text' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/oss-git/mxe.git/tree/?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>root</a>/<a href='/oss-git/mxe.git/tree/src?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>src</a>/<a href='/oss-git/mxe.git/tree/src/qt-2-macosx-gcc-arch.patch?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>qt-2-macosx-gcc-arch.patch</a></div><div class='content'>blob: 5f529166c0f70731d79b5e57545d3f673460b7c6 (<a href='/oss-git/mxe.git/plain/src/qt-2-macosx-gcc-arch.patch?id=ff0e24c2d55caf68cd618d8ea3dd0ca4f0713184'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
<a id='n11' href='#n11'>11</a>
<a id='n12' href='#n12'>12</a>
<a id='n13' href='#n13'>13</a>
<a id='n14' href='#n14'>14</a>
<a id='n15' href='#n15'>15</a>
<a id='n16' href='#n16'>16</a>
<a id='n17' href='#n17'>17</a>
<a id='n18' href='#n18'>18</a>
<a id='n19' href='#n19'>19</a>
<a id='n20' href='#n20'>20</a>
</pre></td>
<td class='lines'><pre><code>This file is part of mingw-cross-env.
See doc/index.html for further information.

The native build complains about:

&quot;You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration.&quot;

diff -ur a/mkspecs/macx-g++/qmake.conf b/mkspecs/macx-g++/qmake.conf
<span class="hl kwb">--- a/mkspecs/macx-g++/qmake.conf	2010-09-26 23:32:05.000000000 +1000</span>
<span class="hl kwa">+++ b/mkspecs/macx-g++/qmake.conf	2010-09-26 23:31:29.000000000 +1000</span>
<span class="hl kwd">&#64;&#64; -13,8 +13,8 &#64;&#64;</span>
 QT			+= core gui
 QMAKE_INCREMENTAL_STYLE = sublib
 
<span class="hl kwb">-QMAKE_CC		 = gcc</span>
<span class="hl kwb">-QMAKE_CXX		 = g++</span>
<span class="hl kwa">+QMAKE_CC		 = gcc -arch i386</span>
<span class="hl kwa">+QMAKE_CXX		 = g++ -arch i386</span>
 
 include(../common/mac-g++.conf)
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='http://git.zx2c4.com/cgit/about/'>cgit v0.12</a> at 2025-11-30 08:15:35 (GMT)</div>
</div> <!-- id=cgit -->
</body>
</html>
