+2007-08-27 Bruno Haible <bruno@clisp.org>
+
+ * x-python.c (phase7_getuc): Interpret octal and hexadecimal escapes
+ as Unicode code points inside Unicode strings.
+ Reported and patch by Jakub Wilk <ubanus@users.sf.net>.
+
2007-08-23 Bruno Haible <bruno@clisp.org>
* file-list.c: Don't include getline.h.
u"abc" \<nl> \\ \' \" \a\b\f\n\r\t\v \ooo \xnn \unnnn \Unnnnnnnn \N{...}
ur"abc" \unnnn
The \unnnn values are UTF-16 values; a single \Unnnnnnnn can expand to two
- \unnnn items. The \ooo and \xnn values are in the current source encoding.
+ \unnnn items. The \ooo and \xnn values are in the current source encoding
+ for byte strings, and Unicode code points for Unicode strings.
*/
static int
phase2_ungetc (c);
}
*backslash_counter = 0;
- return (unsigned char) n;
+ if (interpret_unicode)
+ return UNICODE (n);
+ else
+ return (unsigned char) n;
}
case 'x':
{
if (n2 >= 0)
{
+ int n = (n1 << 4) + n2;
*backslash_counter = 0;
- return (unsigned char) ((n1 << 4) + n2);
+ if (interpret_unicode)
+ return UNICODE (n);
+ else
+ return (unsigned char) n;
}
phase2_ungetc (c2);