From yoriyuki at mbg.ocn.ne.jp Thu Apr 15 09:25:29 2004 From: yoriyuki at mbg.ocn.ne.jp (Yamagata Yoriyuki) Date: Fri, 16 Apr 2004 01:25:29 +0900 (JST) Subject: [Ocaml-i18n] Camomile-0.5.0 Message-ID: <20040416.012529.21602566.yoriyuki@mbg.ocn.ne.jp> Camomile-0.5.0, a new version of Camomile, is available from http://prdownloads.sourceforge.net/camomile/camomile-0.5.0.tar.bz2 Camomile is a comprehensive Unicode library for OCaml. Changes from the previous version are, * Internationalized Pervasives, Char, String, Buffer modules * Search strings by matching collation * Binding to ISO C Locale. - UChar.is_printable - Locale.current_locale, Locale.set_locale - CharEncoding.enc_name * New encodings - iso_c_locale : the encoding specified by the current LC_CTYPE locale. - CP932 * Packed and unpacked libraries. More information is available from our homepage http://camomile.sourceforge.net/ Also, I invite everyone interested in Camomile to join our mailing list. http://lists.sourceforge.net/lists/listinfo/camomile-devel -- Yamagata Yoriyuki From skaller at users.sourceforge.net Thu Apr 15 10:22:00 2004 From: skaller at users.sourceforge.net (skaller) Date: 16 Apr 2004 03:22:00 +1000 Subject: [Ocaml-i18n] Re: [Caml-list] Camomile-0.5.0 In-Reply-To: <20040416.012529.21602566.yoriyuki@mbg.ocn.ne.jp> References: <20040416.012529.21602566.yoriyuki@mbg.ocn.ne.jp> Message-ID: <1082049719.20677.1262.camel@pelican> On Fri, 2004-04-16 at 02:25, Yamagata Yoriyuki wrote: > Camomile is a comprehensive Unicode library for OCaml. Changes from > the previous version are, > > * Internationalized Pervasives, Char, String, Buffer modules Yea! > * Search strings by matching collation > * Binding to ISO C Locale. I have a question here. The C locale concept does need a binding, unfortunately. However it is well known this is a seriously deficient hack, and the use of C locales should be strongly discouraged. C++ uses an imperfect but much better concept: locale's are independent objects which can be passed as arguments to locale sensitive operations. So there is an ISO Standard for handling locale information properly, albiet a C++ one. In the C world a number of different strategies are used to handle this problem. Microsoft is the most advanced, having several different API available for i18n support. Unix solutions also exist .. more than one :D I an wondering what your ideas are for the way forward for Ocaml. -- John Skaller, mailto:skaller at users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net From yoriyuki at mbg.ocn.ne.jp Fri Apr 16 07:32:18 2004 From: yoriyuki at mbg.ocn.ne.jp (Yamagata Yoriyuki) Date: Fri, 16 Apr 2004 23:32:18 +0900 (JST) Subject: [Ocaml-i18n] Re: [Caml-list] Camomile-0.5.0 In-Reply-To: <1082049719.20677.1262.camel@pelican> References: <20040416.012529.21602566.yoriyuki@mbg.ocn.ne.jp> <1082049719.20677.1262.camel@pelican> Message-ID: <20040416.233217.48813959.yoriyuki@mbg.ocn.ne.jp> From: skaller Subject: Re: [Caml-list] Camomile-0.5.0 Date: 16 Apr 2004 03:22:00 +1000 > I have a question here. The C locale concept does need > a binding, unfortunately. However it is well known > this is a seriously deficient hack, and the use > of C locales should be strongly discouraged. > > C++ uses an imperfect but much better concept: locale's > are independent objects which can be passed as arguments > to locale sensitive operations. Camomile has its own locale, and you can (optionally) pass them to the locale-sensitive functions. On the other hand, the functions in I18N-ed stdlib use C locale *name* to guess the default locale. Another use of C locale is code-conversion for standard IO. Binding of C locale functions in Camomile is minimal, just sufficient to achieve these purpose. This is because C locale has portability problems (wch could be even 8-bits, and may not be unicode, and so on.) and generally weak functionality. Another reason is that I want Camomile strictly follow Unicode Standard, while ISO-C does not. As OCaml on the whole, I think the best strategy would depend on application. Desktop applications would required to be consistent with other C applications, so using OS functions (for example Glib one, or Win API) would be best. For a network application, on the other hand, platform-independence would be desirable. For such a case, Camomile like approach (everything implemented by OCaml) would be better. -- Yamagata Yoriyuki