RE: Special Encoding
"Carl W. Brown" <[email protected]>
| Newsgroups | gmane.comp.lib.icu.general |
|---|---|
| Message-ID | <[email protected]> |
Jon, > -----Original Message----- > From: [email protected] > [mailto:[email protected]]On Behalf Of Peck, Jon > Sent: Saturday, September 06, 2003 12:51 PM > To: George Rhoten; Sinha, Vineesh > Cc: [email protected] > Subject: RE: Special Encoding > > > To clarify what Vineesh is trying to do: the input text is in a > known Windows code page (or equivalent Unix/Linux encoding), but > that is not necessarily the code page/locale of the operating > system or process. The output is supposed to be UTF-8, and the > code page of the input text may change at known points during the session. > This is why I suggested using context switching. You change contexts during the session to reflect the encoding at that specific point in the session. Then invoking code that is a thin wrapper to the ICU code you invoke ICU using the appropriate converters and locales. The wrapper will ensure that the appropriate locale and converter parameters are passed to ICU. It can manage intermediate work areas that may be needed for double conversions or function work areas. It can reuse converters for small field conversions and break up large buffers to reduce the size of intermediate storage. Above all it gives you better platform independence and full thread safety. Carl