[Mono-devel-list] culture info patches

Jackson Harper jackson at ximian.com
Tue Mar 16 10:30:48 EST 2004


	Yeah originally I wanted to do that but for the sake of keeping the
code clean for now I've decided to let the data be duplicated. One nice
thing with the setup I have now is that the date format and number
format tables can be 'compressed' by eliminating duplicate rows and
having culture info entries share the same indexes.


On Tue, 2004-03-16 at 07:07, Ben Maurer wrote:
> Hey,
> In general this looks very nice. One specific comment I had from looking
> at the code:
> So in the tables we have stuff like:
> static const CultureInfoEntry culture_entries [] = {
> {0x0009, "English", "English", "English", "eng", "en", -1, -1},
> {0x1009, "English (Canada)", "English (Canada)", "English (Canada)",
> "eng", "en", 0, 0},
> {0x0409, "English (United States)", "English (United States)", "English
> (United States)", "eng", "en", 1, 1},
> As I understand it, a string like "English" gets created multiple times
> when you create the culture info. Maybe you need some interning here.
> This would help in other places too: for example, all the english
> varients use the same names for the days of the week, so you save a
> creation there.
> Also, can you open up monodevelop and do stuff. I know that requires
> culture info stuff.
> -- Ben
> >>> Jackson Harper <jackson at ximian.com> 03/16/04 03:53 AM >>>
> Here is a semi-finished set of patches to our CultureInfo
> implementation. These patches move the data into the runtime so ICU is
> not needed. The data is generated from the open18n xml files and the
> generator is configurable so we can easily "patch" data without editing
> the existing xml files (so we can stay in sync easily). I was able to do
> a full bootstrap (in en_CA, and en_US) and run xsp with these patches
> applied.
> I've only included a small subset of the generated data to keep the
> patch small and to make testing a little easier. cultures supported are
> en_CA, en_US, es_ES, and ja_JP. I also haven't included the
> locale-builder tool.
> To use the existing CultureInfo w/ICU implementation instead of the new
> one you can set the env var MONO_ICU_CULTURE_INFO to TRUE.
> There is still some work to do but feedback is appreciated.
> Love,
> Jackson
> TODO: 
> - Still not getting all the data into tables, lots of String.Emptys
> right now
> - Only generate the CultureMap in CultureInfo.cs for supported cultures
> - Make generated tables more prettier
> - Add headers to Makefile.am
> ChangeLog:
> icall.c: New icall for constructing CultureInfo's from lcid.
> locales.c: Fill in CultureInfo objects from culture table data.
> culture-info.h: CultureInfo data structs. Each culture info entry has an
> index into the number format table, and the date time format table
> unless the entry is a neutral culture, then it has -1 for its indexes.
> culture-info-tables.h: Generated locale data. This file is generated by
> locale-builder.exe
> CultureInfo.cs: Construct culture infos using the new from_lcid method
> unless an env var is set.

More information about the Mono-devel-list mailing list