[sword-devel] MacSword 1.1.3

Martin Gruner mg.pub at gmx.net
Thu Nov 25 04:59:44 MST 2004


Hey Joachim,

could you please write some more instructions in stringmgr.h how to override 
this class? That would be helpful, I guess. =)

mg

Am Donnerstag, 25. November 2004 12:33 schrieb Joachim Ansorg:
> Hi,
>
> it's simple - I hope :)
>
> > So all I have to do is replace char* StringMgr::upperUTF8(char* t,
> > const unsigned int maxlen)?
>
> Reimplement upperUTF8 and then tell Sword to use an instance of your
> reimplementation to handle Unicode/Latin1 Strings with
> StringMgr::setSystemStringMgr.
>
> > If so, then what is maxlen for? Is it expecting t to be overwritten or
> > just a maximum buffer allocated? I assume that sword will dealloc any
> > buffer I return.
>
> If maxlen is > 0 upper only maxlen chars. It expects t to be overwritten.
> No buffers are allocated withing upperUTF8. I attached the BTStringMgr we
> use in BibleTime.
> I advise to check a string if it contains unicode chars before uppering the
> chars using Unicode. Checking is a lot faster than without.
>
> I hope that helps. And yes, we need better documentation :)
>
> If you return true in supportsUnicode then LocaleMgr will only load locales
> which are in UTF-8, so you can be sure that all verse keys are in UTF-8.
>
> Let me know if you need help,
> Joachim


More information about the sword-devel mailing list