From: Dennis S. <dso...@us...> - 2008-08-22 02:40:19
|
Update of /cvsroot/jibx/core/build/src/org/jibx/runtime/impl In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv20147/src/org/jibx/runtime/impl Modified Files: InputStreamWrapper.java Log Message: Throw an exception if first byte of UTF-8 sequence is invalid. Index: InputStreamWrapper.java =================================================================== RCS file: /cvsroot/jibx/core/build/src/org/jibx/runtime/impl/InputStreamWrapper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** InputStreamWrapper.java 18 Dec 2007 06:21:17 -0000 1.5 --- InputStreamWrapper.java 22 Aug 2008 02:40:16 -0000 1.6 *************** *** 1,4 **** /* ! Copyright (c) 2004-2007, Dennis M. Sosnoski. All rights reserved. --- 1,4 ---- /* ! Copyright (c) 2004-2008, Dennis M. Sosnoski. All rights reserved. *************** *** 516,520 **** } ! } else { // three-byte character, check bytes available and store --- 516,520 ---- } ! } else if ((byt & 0xE0) == 0xE0) { // three-byte character, check bytes available and store *************** *** 529,532 **** --- 529,534 ---- throw new IOException("UTF-8 conversion error"); } + } else { + throw new IOException("UTF-8 lead character error: 0x" + Integer.toHexString(byt & 0xFF)); } } |