[sword-svn] r2448 - in trunk: bindings/corba/java/src/org/crosswire/sword/orb src/utilfuns
scribe at crosswire.org
scribe at crosswire.org
Fri Aug 28 11:11:57 MST 2009
Author: scribe
Date: 2009-08-28 11:11:57 -0700 (Fri, 28 Aug 2009)
New Revision: 2448
Modified:
trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
trunk/src/utilfuns/utilstr.cpp
Log:
fixed utf8->32 conversion to error out properly on invalid byte sequences.
Should be able to try moving swordweb over to omniorb now and remove our hack to fix java/orbit utf-8 incompat.
Modified: trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
===================================================================
--- trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java 2009-08-24 04:01:29 UTC (rev 2447)
+++ trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java 2009-08-28 18:11:57 UTC (rev 2448)
@@ -249,14 +249,14 @@
ModInfo[] modInfoList = mgr.getModInfoList();
System.out.println("sequence size: " + modInfoList.length);
SWModule module;
+ for (int i = 0; i < modInfoList.length; i++) {
+ System.out.println(modInfoList[i].name + ": " + modInfoList[i].category + ": " + modInfoList[i].language + ": " + modInfoList[i].description);
/*
- for (int i = 0; i < modInfoList.length; i++) {
- System.out.println(modInfoList[i].name + ": " + modInfoList[i].category + ": " + modInfoList[i].language);
module = mgr.getModuleByName(modInfoList[i].name);
module.setKeyText("jas1:19");
System.out.println(module.getRenderText());
+*/
}
-*/
/*
module = mgr.getModuleByName("WHNU");
module.setKeyText("rev.22.21");
Modified: trunk/src/utilfuns/utilstr.cpp
===================================================================
--- trunk/src/utilfuns/utilstr.cpp 2009-08-24 04:01:29 UTC (rev 2447)
+++ trunk/src/utilfuns/utilstr.cpp 2009-08-28 18:11:57 UTC (rev 2448)
@@ -21,6 +21,7 @@
#include <sysdata.h>
#include <swlog.h>
+#include <swbuf.h>
SWORD_NAMESPACE_START
@@ -223,6 +224,12 @@
multibuf[0] <<= 1;
multibuf[subsequent] = (*buf)[subsequent];
multibuf[subsequent] &= 63;
+ // subsequent byte did not begin with 10XXXXXX
+ // move our buffer to here and error out
+ if (((*buf)[subsequent] - multibuf[subsequent]) != 128) {
+ *buf += subsequent;
+ return 0;
+ }
ch <<= 6;
ch |= multibuf[subsequent];
}
More information about the sword-cvs
mailing list