From: Finn B. <bc...@us...> - 2001-01-21 16:21:26
|
Update of /cvsroot/jython/jython/org/python/core In directory usw-pr-cvs1:/tmp/cvs-serv517 Modified Files: PyString.java Log Message: isunicode(): Added helper method. Returns true when the string contains a character > 255. Index: PyString.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PyString.java,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -r2.33 -r2.34 *** PyString.java 2001/01/21 14:00:33 2.33 --- PyString.java 2001/01/21 16:21:36 2.34 *************** *** 1687,1690 **** --- 1687,1700 ---- } + public boolean isunicode() { + int n = string.length(); + for (int i = 0; i < n; i++) { + char ch = string.charAt(i); + if (ch > 255) + return true; + } + return false; + } + public PyString encode() { return encode(null, null); |