perl-unicode

Re: Encode from XS

2003-08-09 00:30:05
Simon Cozens <simon(_at_)simon-cozens(_dot_)org> writes:
simon(_at_)simon-cozens(_dot_)org (Simon Cozens) writes:
Can someone give me a few quick examples of creating Encode::XS objects
to do simple transcoding, from XS?

I think I expressed myself badly. Perhaps I don't mean "creating" Encode::XS
objects, but instantiating them.

Let's say I'm in XS, I have an EUC-JP bit of text, and I want to convert it
to UTF-8. What's the code to do that?


It isn't trivial - what do you want to do when it doesn't convert,
when your target buffer is too small etc.
So what I do in PerlIO::encoding and Tk804 is just call perl 
API via normal PUSHMARK(sp); XPUSHs; call_method() scheme.

Dan gave you that.

<Prev in Thread] Current Thread [Next in Thread>