[sword-devel] problem with key setting

Chris Little chrislit at crosswire.org
Wed Sep 2 00:31:01 MST 2009



Karl Kleinpaste wrote:
> I need a help with a key problem.  I have a module name and a textual
> key . I'm operating in Swedish locale, e.g. LC_ALL=sv_SE LANG=sv.
> 
> const char *BackEnd::get_osisref_from_key(const char *module, const char *key)
> {
>     ModMap::iterator it;
>     it = main_mgr->Modules.find(module);
>     if (it == main_mgr->Modules.end())
>         it = main_mgr->Modules.begin();
>     if (it == main_mgr->Modules.end())
>         return "";
>     VerseKey *vk = (VerseKey*)(*it).second->getKey();
>     *vk = key;
>     return vk->getOSISRef();
> }
> 
> It does not have desired effect.  With module "NET" and key
> "1. Timoteusbrevet 3:1", this code returns "Rev.1.1".
> 
> vk->convertToOSIS() returns something correct but wrongly formatted for
> my purposes:
>     "<reference osisRef=\"1Tim.3.1\">1. Timoteusbrevet 3:1</reference>"
> So it knows how to do the conversion, but it's wrapped in excess crud.
> 
> I need "1Tim.3.1", all by itself.  Clues?

No real clues, but does vk->getOSISRefRangeText() give you what you 
would expect?

Does it all work as expected with the locale set to English?



More information about the sword-devel mailing list