Update of /cvsroot/jython/jython/org/python/core
In directory usw-pr-cvs1:/tmp/cvs-serv4751
Modified Files:
PyString.java
Log Message:
encode_UnicodeEscape(): Use the \xNN encoding for 127 >= values >= 255.
Index: PyString.java
===================================================================
RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v
retrieving revision 2.50
retrieving revision 2.51
diff -C2 -d -r2.50 -r2.51
*** PyString.java 2001/10/28 17:13:43 2.50
--- PyString.java 2001/11/27 11:18:04 2.51
***************
*** 388,396 ****
else if (use_quotes && ch == '\f') v.append("\\f");
else if (use_quotes && ch == '\r') v.append("\\r");
! else if (ch < ' ' || ch >= 128) {
! v.append('\\');
! v.append(hexdigit[(ch >> 6) & 7]);
! v.append(hexdigit[(ch >> 3) & 7]);
! v.append(hexdigit[ch & 7]);
}
/* Copy everything else as-is */
--- 388,395 ----
else if (use_quotes && ch == '\f') v.append("\\f");
else if (use_quotes && ch == '\r') v.append("\\r");
! else if (ch < ' ' || ch >= 127) {
! v.append("\\x");
! v.append(hexdigit[(ch >> 4) & 0xF]);
! v.append(hexdigit[ch & 0xF]);
}
/* Copy everything else as-is */
|