ICU4C proposal: Change some functions in icuio
George Rhoten <[email protected]>
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <OFA426ECA5.19E8B296-ON86256DB9.00678F5D-88256DB9.00703DE4@us.ibm.com> |
I'd like to make the following changes to icuio API. These changes are being proposed to make it easier for current stdio C users to transition to the newer implementation of the icuio library, and to better support the features of Unicode. 1) Reverse the order of arguments for u_fgets. Right now, the opposite ordering of the arguments makes it annoying when porting an old application to using fgets() to start using u_fgets(). You have to make some unnecessary changes to use the ICU API. Here is the new ordering: u_fgets(UChar *s, int32_t n, UFILE *f); For reference, here is the original ordering. u_fgets(UFILE *f, int32_t n, UChar *s); 2) Make u_fungetc take a UChar32 parameter and return a UChar32 value. This makes it easier to put supplementary characters back into the file. A UChar can still be used with this API without a cast. For reference, the ungetc() function from stdio takes an int parameter and not a char parameter. u_fungetc(UChar32 c, UFILE *f); 3) Stop unescaping characters in u_fgetcx. A Transliterator can be used to achieve the same results, and a Transliterator is better suited to get the right unescaping to be performed. This function will remain as API to allow getting UChar32 characters, but it won't escape the characters anymore. Background information: The icuio library was scheduled to be supported in ICU 2.8. Due to scheduling conflicts with more important bugs and requests that recently came up, the icuio library won't become supported in 2.8 as originally planned. The icuio library will remain unsupported in 2.8. These proposed changes are just a step towards supporting this library. Some of the changes for 2.8 will improve the features, performance and stability of the icuio library. The changes just aren't as grand as we had hoped for. Deadline for comments: October 15, 2003 George Rhoten IBM Globalization Center of Competency/ICU San José, CA, USA