<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi.<div><br></div><div>I'm testing a little with some GenBooks and trying to fix issues.</div><div>All GenBooks work pretty good in MacSword except Institues and Heretics.</div><div><br></div><div>For Heretics I found that addressing two keys work, that is: </div><div>"I. Introductory Remarks..." and</div><div>"VIII. The Mildness of the Yellow Press"</div><div><br></div><div>All others fail. I noticed that all of them end with a space character. The two that work do not.</div><div>In Institutes many keys end with space character but some do not and addressing them doesn't work either.</div><div><br></div><div>What are the experiences for these GenBooks for other front end developers?</div><div><br></div><div>Below is the method that tries to address the key and pull out the text:</div><div>Why does this actually not work with TreeKeyIdx? When using this subclass, error is always set.</div><div>The ref string that comes in here is the string that is retrieved by calling TreeKeyIdx::getText(). The full path.</div><div><br></div><div><br></div><div>Regards,</div><div>Manfred</div><div><br></div><div><br></div><div>------------------</div><div><div><font class="Apple-style-span" face="Courier">- (NSString *)htmlForRef:(NSString *)ref {</font></div> <div><font class="Apple-style-span" face="Courier"> NSString *ret = @"";</font></div> <div><font class="Apple-style-span" face="Courier"> </font></div> <div><font class="Apple-style-span" face="Courier"> // lock</font></div> <div><font class="Apple-style-span" face="Courier"> [moduleLock lock];</font></div> <div><font class="Apple-style-span" face="Courier"><br></font></div> <div><font class="Apple-style-span" face="Courier"> const char *refStr = NULL;</font></div> <div><font class="Apple-style-span" face="Courier"> // encoding depends on module encoding</font></div> <div><font class="Apple-style-span" face="Courier"> if([self isUnicode]) {</font></div> <div><font class="Apple-style-span" face="Courier"> refStr = [ref cStringUsingEncoding:NSUTF8StringEncoding];</font></div> <div><font class="Apple-style-span" face="Courier"> } else {</font></div> <div><font class="Apple-style-span" face="Courier"> refStr = [ref cStringUsingEncoding:NSISOLatin1StringEncoding];</font></div> <div><font class="Apple-style-span" face="Courier"> }</font></div> <div><font class="Apple-style-span" face="Courier"> </font></div> <div><font class="Apple-style-span" face="Courier"> //<a href="sword::TreeKeyIdx">sword::TreeKeyIdx</a> *key = new <a href="sword::TreeKeyIdx(refStr)">sword::TreeKeyIdx(refStr)</a>;</font></div> <div><font class="Apple-style-span" face="Courier"> <a href="sword::SWKey">sword::SWKey</a> *key = new <a href="sword::SWKey(refStr)">sword::SWKey(refStr)</a>;</font></div> <div><font class="Apple-style-span" face="Courier"> char err = key->Error();</font></div> <div><font class="Apple-style-span" face="Courier"> module->setKey(key);</font></div> <div><font class="Apple-style-span" face="Courier"> if(key) {</font></div> <div><font class="Apple-style-span" face="Courier"> delete key;</font></div> <div><font class="Apple-style-span" face="Courier"> }</font></div> <div><font class="Apple-style-span" face="Courier"> </font></div> <div><font class="Apple-style-span" face="Courier"> char *bytes = (char *)module->RenderText();</font></div> <div><font class="Apple-style-span" face="Courier"> [moduleLock unlock];</font></div> <div><font class="Apple-style-span" face="Courier"> </font></div> <div><font class="Apple-style-span" face="Courier"> ret = [NSString stringWithUTF8String:bytes];</font></div> <div><font class="Apple-style-span" face="Courier"> </font></div> <div><font class="Apple-style-span" face="Courier"> return ret;</font></div> <div><font class="Apple-style-span" face="Courier">}</font></div> ----------------</div></body></html>