CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [Zhris] Reg. Chinese chars ???: Edit Log

New User

Sep 12, 2012, 9:17 PM

Views: 1775
Re: [Zhris] Reg. Chinese chars ???

Thanks Zhris.
But i cant make the script so specific to only CN...

i need to make it generic UTF-8 to handle all languages.

Below is the code which writes the text into XLS file -

sub write_file                  
my $contents = shift;
my $filename = shift;
$g_error_message .= "Writing empty file $filename" unless $contents =~ /\S/;

open(FILE1,"> $filename");
#print_log('filenamessS--- '.$filename);
#print_log('contentssS--- '.Encode::encode( "UTF-8", $contents ));
#my $contents_utf = Encode::encode( "UTF-8", $contents );
#open (FILE1 ,"> encoding(utf8)", "$filename");
binmode FILE1,':utf8';
print FILE1 $contents;
close FILE1;
return 0;

Any pointers to this experts ???
Help really appreciated...

Thanks & Regards,

(This post was edited by dr.codin on Sep 12, 2012, 9:19 PM)

Edit Log:
Post edited by dr.codin (New User) on Sep 12, 2012, 9:19 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives