in reply to Re: MultiByte Char handling in perl
in thread MultiByte Char handling in perl

Thanks for the reply. Please don't worry about the syntax and petty things there. That was to explain. Simply put I want to understand when a function in Perl returns a value, is there a possibility that its encoding gets changed ? WHat i understand is perl must have an inbuilt charset support .How do we change that ? i remember doing this in C by setting lc-ctype

Replies are listed 'Best First'.
Re^3: MultiByte Char handling in perl
by Eliya (Vicar) on Mar 07, 2012 at 17:41 UTC
    WHat i understand is perl must have an inbuilt charset support .How do we change that ?

    Perl has built-in support for Unicode (which in itself is not an encoding).  You don't want to change that.  Rather, to use this functionality, you'd decode your data on input (into Perl's internal form), and encode it on output. With both steps, you can specify an encoding.  How Perl represents and handles its internal form is not your business.

    See perluniintro to start with.

Re^3: MultiByte Char handling in perl
by Anonymous Monk on Mar 07, 2012 at 17:56 UTC
    Here is an example of whats happening.
    print "charEncoding string val = " . $enc->($val) . "\n\n"; #prints charEncoding string val = 歡迎來到&#38 +597;虎! my $encoded = $enc->($val); print "\n charEncodingo $encoded == $val " ; #prints charEncodingo 歡迎來到雅è™& +#142;! == 歡迎來到雅虎!
    Can someone throw some light here. Please don't look at syntax errors.