|
Boost : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-08-08 03:23:25
Ronald Garcia wrote:
> Yitzhak Sapir wrote:
> >I had seen some conversion facets in the boost files area. What are
> > those?
> >
> >Also, it's my understanding (after having written my own Unicode
> > conversion facet) that there is no way to portably write conversion
> > facets, although it's possible to get close. I had written about this in
> > comp.lang.c++.moderated:
> > http://groups.google.com/groups?selm=23be9fc5.0202270746.436ac5b9%40posti
> >ng.google.com&output=gplain I really hope these issues are solved
> > somehow. It would be wonderful to be able to write compression or
> > encryption conversion facets.
>
> There are two independent implementations of unicode codecvt facets in
> the files section. I wrote one in order to learn about both extending
> iostreams and unicode itself.
[snip]
> There is also another codecvt facet (codecvt.zip) which I believe
> handles a superset of the above facet, but I only looked at it briefly a
> while ago and I don't think it had documentation.
That one is written by my and has actually two facets, one which handles
UTF-8 externally and another which handles UCS2. Unlike Ronald's code,
there's no transforming iterator.
BTW, I've looked at the post that Yitzhak mentioned and which in particular
says that use of "mbstate_t" makes code conversion facets unportable.
Not sure what I think about that statement, but at least unicode facet need
not use state at all -- in my case it just returns "partial" when appropriate.
- Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk