Nik has asked for the wisdom of the Perl Monks concerning the following question:
Hello i have the following code:
here is the output of this code: http://tech-nikos.gr/cgi-bin/test.pl
i tried to switch the encoding from greek to utf8 but if i use it or don't use it output produces remains the same. Any ideas why?
I don't know why but when i get the whole bunch of files form '/data/text' folder and print it although the path that preceed each of the files appear ok the filename itself appear liek squares(weird encoding)#!/usr/bin/perl -w use strict; use CGI::Carp qw/fatalsToBrowser/; use CGI qw/:standard/; use DBI; use Encode; print "Content-Type: text/html\n\n"; my @files = glob "$ENV{'DOCUMENT_ROOT'}/data/text/*.txt"; my @menu_files = map {/([^\/]+)\.txt$/} @files; Encode::from_to(@menu_files, 'ISO-8859-7', 'utf8'); print "@files"; print "@menu_files";
here is the output of this code: http://tech-nikos.gr/cgi-bin/test.pl
i tried to switch the encoding from greek to utf8 but if i use it or don't use it output produces remains the same. Any ideas why?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Weird encoding after grabing filenames
by moritz (Cardinal) on Jun 16, 2009 at 19:48 UTC | |
by Nik (Initiate) on Jun 16, 2009 at 20:27 UTC | |
by ikegami (Patriarch) on Jun 16, 2009 at 20:53 UTC | |
by Nik (Initiate) on Jun 17, 2009 at 09:42 UTC | |
by graff (Chancellor) on Jun 16, 2009 at 20:53 UTC | |
by Nik (Initiate) on Jun 17, 2009 at 09:49 UTC | |
by ikegami (Patriarch) on Jun 17, 2009 at 14:13 UTC | |
|
Back to
Seekers of Perl Wisdom