[sword-devel] swlocale question

Troy A. Griffitts scribe at crosswire.org
Thu Sep 3 17:08:08 MST 2009


Matthew,

Are you sure you want the encoding of the locale?  They should all be in
 UTF-8 if you are using a unicode enabled sword lib.

SWLocale::getEncoding merely returns the [Meta] Encoding= entry from the
locale file.  If one does not have an entry, then it will be null.

But again, the most common scenario is that your
StringMgr::hasUTF8Support() will return true, and in this case the
engine should only return the UTF-8 versions of locales.

	-Troy.



Matthew Talbert wrote:
> I'm trying to debug a problem with locale support in Xiphos. Is there
> really any documentation anywhere about how Locales work? In
> particular, how SWORD decides which locale to use, etc.
> 
> Specifically right now, we have a situation where we have this code:
> 
> 		LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(sys_locale);
> 		sw_locale = LocaleMgr::getSystemLocaleMgr()->getLocale(sys_locale);
> 		OLD_CODESET = (char*)sw_locale->getEncoding();
> 
> Now OLD_CODESET should contain the locale's encoding. What does it
> mean if it is null?
> 
> Thanks,
> Matthew
> 
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list