[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] AElfred Bug and Patch
I have received a bug report for AElfred 1.1 (and earlier versions) concerning the treatment of signed bytes in UCS-2/UTF-16 and UCS-4 encoded text. I will put out a maintenance version 1.1.1 in a few days, once other people have had time to report any additional bugs; in the mean time, since the patch is tiny (1,529 characters), I am including here for anyone who needs UCS-2/UTF-16 or UCS-4 right away. Thanks to Yoshida Masato for the bug report. ====================8<====================8<==================== *** XmlParser.java 1998/03/09 11:51:40 2.3 --- XmlParser.java 1998/03/10 12:13:53 *************** *** 3961,3968 **** encodingError("odd number of bytes in UCS-2 encoding", -1, count); } for (int i = 0; i < count; i+=2) { ! readBuffer[j++] = (char)((rawReadBuffer[i] << shift1) | ! (rawReadBuffer[i+1] << shift2)); if (readBuffer[j-1] == '\r') { sawCR = true; } --- 3961,3969 ---- encodingError("odd number of bytes in UCS-2 encoding", -1, count); } for (int i = 0; i < count; i+=2) { ! readBuffer[j++] = ! (char)(((rawReadBuffer[i] & 0xff) << shift1) | ! ((rawReadBuffer[i+1] & 0xff) << shift2)); if (readBuffer[j-1] == '\r') { sawCR = true; } *************** *** 3999,4008 **** -1, count); } for (int i = 0; i < count; i+=4) { ! value = ((rawReadBuffer[i] << shift1) | ! (rawReadBuffer[i+1] << shift2) | ! (rawReadBuffer[i+2] << shift3) | ! (rawReadBuffer[i+3] << shift4)); if (value < 0x0000ffff) { readBuffer[j++] = (char)value; if (value == (int)'\r') { --- 4000,4009 ---- -1, count); } for (int i = 0; i < count; i+=4) { ! value = (((rawReadBuffer[i] & 0xff) << shift1) | ! ((rawReadBuffer[i+1] & 0xff) << shift2) | ! ((rawReadBuffer[i+2] & 0xff) << shift3) | ! ((rawReadBuffer[i+3] & 0xff) << shift4)); if (value < 0x0000ffff) { readBuffer[j++] = (char)value; if (value == (int)'\r') { ====================8<====================8<==================== All the best, David -- David Megginson ak117@f... Microstar Software Ltd. dmeggins@m... http://home.sprynet.com/sprynet/dmeggins/ xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|