[lokisetup] localization?

Ryan C. Gordon icculus at icculus.org
Sat Jun 10 19:11:47 EDT 2006

>>I don't think you should abuse the 'lang' xml attribute for the encoding. Just
>>introduce an 'encoding' attribute for that purpose. For backward compatability
>>you can use g_utf8_validate() to check whether a text is valid utf8 and assume
>>iso8859-1 if not. g_convert() can recode the string in this case.
> The encoding is in the LANG variable that the system supplies to 
> loki_setup. I'm open to anything, but I don't have the mental capacity 
> to make a better patch right now. Crunch time really sucks.  :/
> Been sitting at this desk for about two days now,

But sleep helps immensely: how's this patch:

If you specify a portion of the localization, it'll consider it for the 
matching. If you don't, it won't. So if you do "fr.utf8" it'll match 
someone with "fr" or "fr_FR" or "fr_CA.utf8 at blah" but not someone with 
"fr.latin1" ...

So most people will use this like they always have: <eula lang="fr">, 
but if you need to force a non-utf8 encoding, or customize for a 
territory (fr_CA, etc), or both, you can.

I don't think this needs a seperate "encoding" attribute in the XML tag, 
since it would require updating lots of places (eula, readme, other 
places) and the thing we're comparing against encodes the encoding type 
in the string anyhow, so keeping them paired makes sense.

I haven't touched anything in the GTK code to convert to/from utf8...all 
the data we're shipping is in UTF-8 format at the moment, so I don't 
really care further at this moment.


More information about the Lokisetup mailing list