Solved

Apache, mod_perl and utf-8

Posted on 2007-12-07
4
812 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now