[sword-devel] swlocale question

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


Matthew,

There is some interesting code in setDefaultLocaleName.  If you do a
blame on this, you might find who can help you with the logic.  Don't
have time right now to check but the comments are beyond my logic of
system locales, so it's not likely me (unless I reformatted it).

Anyway, as Jonathan Marsden mentioned earlier, if you are parsing system
locale strings and trying to set and appropriate SWORD locale from such,
we could sure use that logic in the engine for everyone to take
advantage of.

Regarding your comments on InstallMgr code, not to sound defensive, but
I certainly don't remember not being interested in fixing the
shortcoming in the lib.  I'll write a short email to your 3 suggestions
in another email.

	-Troy.



Matthew Talbert wrote:
> On Thu, Sep 3, 2009 at 8:08 PM, Troy A. Griffitts<scribe at crosswire.org> wrote:
>> 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.
> 
> Well, actually I just want a valid locale :). I just noticed that this
> code was there and was returning null, so I wondered why. (this is
> very old code that isn't actually being used for anything anymore, I
> think).
> 
>> SWLocale::getEncoding merely returns the [Meta] Encoding= entry from the
>> locale file.  If one does not have an entry, then it will be null.
> 
> yes, but it also returns null if you specify an invalid locale.
> 
> The problem was that we have a very bad algorithm for determining what
> locale name to use, therefore the locale was always invalid. I'm not
> sure of the best way to check that we have a valid locale, but we
> should be doing that. Should SWORD return an error if we assign a
> locale that doesn't exist?
> 
> Thanks for the help,
> 
> 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