[p4perl] Re: P4WEB and Unicode Servers

Tony Smith tony@smee.org
Tue, 7 Dec 2004 17:57:14 +0000


Glad to hear it - thanks for letting me know.

Tony

On Tuesday 07 December 2004 17:54, Raymond Danks wrote:
> Tony,
>
> OK.  I updated to 3.4676 and all is well.
>
> Thanks,
>
> Ray
>
> Tony Smith wrote:
> >Hi Ray,
> >
> >Here's my implementation of SetCharset().
> >
> >SV *
> >PerlClientApi::SetCharset( const char *c )
> >{
> >    CharSetApi::CharSet cs = CharSetApi::Lookup( c );
> >    if( cs == (CharSetApi::CharSet) -1 )
> >    {
> >        warn( "Unknown charset ignored. Check your code or P4CHARSET." );
> >        return &PL_sv_undef;
> >    }
> >    client->SetTrans( cs, cs, cs, cs );
> >    client->SetCharset( c );
> >    return &PL_sv_yes;
> >}
> >
> >So you can see I call _both_ ClientApi::SetCharset() and
> > ClientApi::SetTrans() to cover all the bases - and yes, it definitely
> > works.
> >
> >For what it's worth ClientApi::SetCharset() is very limited and SetTrans()
> > is the one that does the real work. SetCharset() is nice because it
> > stores the textual name of the charset which we can later retrieve with
> > GetCharset().
> >
> >Tony