Solved

Apache, mod_perl and utf-8

Posted on 2007-12-07
4
821 Views
Last Modified: 2013-11-13
Hy all

I'm getting crazy with mod_perl and utf-8. I already did everything that I found in the web about this and nothing works.

use Encode;
use utf8;

sub handler() {
      my $r = shift;
      $r->content_type('text/html; charset=utf-8');
      
      my $output = "<html><body>aécãcça ".time."</body></html>";
      
#      utf8::encode $output;
#      $r->print(Encode::encode('utf-8', $output));
      $r->print($output);
}


I don't know if this shall be about configuration.

PLEASE HELP, This is my first website done from 0, and I'm getting crazy.

Thanks
0
Comment
Question by:oleber
4 Comments
 
LVL 10

Accepted Solution

by:
oleber earned 0 total points
ID: 20426400
Solved:

sub handler() {
      my $r = shift;
      $r->content_type('text/html; charset=utf-8');
      $r->send_http_header();
            
      my $output = "<html><body>aécãcça ".time."</body></html>";

      $r->print($output);
}
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20442962
From the solution, I'm guessing the problem was you weren't sending proper headers before.
If you add this to your script, the errors will show up on the browser, instead of in the logs.  This can make it easier to debug:
use CGI::Carp 'fatalsToBrowser';
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20554883
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 80
VB6 Compile Compatibility Issue 4 102
Tembedded WB animatid gifs not animated on some pcs 2 80
Help Required 3 97
A short article about a problem I had getting the GPS LocationListener working.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question