[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

Apache, mod_perl and utf-8

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
oleber
Asked:
oleber
1 Solution
 
oleberAuthor Commented:
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
 
Adam314Commented:
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
 
Vee_ModCommented:
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now