Result:
found more than 370 distributions - search limited to the first 2001 files matching your query ( run in 2.540 )


Apache-Request-I18N

 view release on metacpan or  search on metacpan

I18N.pm  view on Meta::CPAN

my $SPACE	 = '\040';
my $CTL		 = '\000-\037\377';
my $especials	 = quotemeta '()<>@,;:\\"/[]?.=';

my $token	 = qr/ [^ $SPACE $CTL $especials ]+ /x;
my $charset	 = $token;
my $language	 = $token;
my $encoding	 = $token;
my $encoded_text = qr/ [ \041-\076 \100-\176 ]+ /x;
my $encoded_word = qr/ =\? $charset (?: \* $language )? \? $encoding \?
							$encoded_text \?= /x;

sub _decode_value {
	my ($self, $value) = @_;

I18N.pm  view on Meta::CPAN

	my %args = map { defined $_ ? $_ : '' }
			map Apache::unescape_url_info(defined $_ ? $_ : ''),
				map /^([^=]*)(?:=(.*))?/,
					split /[&;]+/ => $self->query_string;

	# Extract the Content-Type charset for x-www-form-urlencoded
	my ($is_urlenc, $charset);
	my ($ctype) = split_header_words($self->header_in('Content-Type'));
	if ($ctype->[0] && $ctype->[0] eq 'application/x-www-form-urlencoded') {
		$is_urlenc = 1;
		my %tmp = @$ctype;
		$charset = $tmp{charset};
	}

	my $old_parms = $self->SUPER::parms;
	my $new_parms = new Apache::Table $self, scalar keys %$old_parms;

I18N.pm  view on Meta::CPAN

		# POSTed multipart/form-data form field names are supplied as
		# a Content-Disposition parameter, so they are handled
		# differently.

		if ($is_urlenc || $args{$key}) {
			$key = $self->_decode($key, $charset);
		} else {
			$key = $self->_decode_value($key);
		}

		# Same thing for filenames

		if ($self->SUPER::upload($key)) {
			$val = $self->_decode_value($val)
		} else {
			$val = $self->_decode($val, $charset);
		}

		$_ = $self->_encode($_) foreach $key, $val;

		$new_parms->add($key, $val);

I18N.pm  view on Meta::CPAN

standard-compliant user-agent may be wrongly decoded.

=item *

When using the B<multipart/form-data> encoding, each form field value may have
its character encoding specified via the I<charset> parameter of its
I<Content-Type> header.  This value is currently ignored.  (This is due to a
limitation in I<libapreq>.)

Similarly, the I<Content-Transfer-Encoding> header is also ignored.

I18N.pm  view on Meta::CPAN

We should probably make _mangle_parms lazy, and only call it from param() and
such.

=item *

Automatically decode the contents of a B<text/*> file upload if a charset has
been provided.

=for comment
This should probably be optional, since we wouldn't know what to do with an
upload that doesn't have a charset.  (Neither DECODE_PARMS nor the local
native charset would be appropriate here.)  Besides, if ENCODE_PARMS was
defined, we'll still return a handle that spits out wide characters.  (Come to
think of it, do any user-agents even bother providing a charset anyway?)

=item *

Allow for more than one DECODE_PARMS, and try to guess which one is
appropriate.

I18N.pm  view on Meta::CPAN

Write a short text about the various standards and issues.


=head1 SEE ALSO

 <http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html>

 RFC 1522 - MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text
 RFC 1806 - Communicating Presentation Information in Internet Messages: The Content-Disposition Header [2.3]
 RFC 1866 - Hypertext Markup Language - 2.0 [8.2.1]
 RFC 1867 - Form-based File Upload in HTML [3.3, 5.11]

 view all matches for this distribution


Apache-SWIT

 view release on metacpan or  search on metacpan

lib/Apache/SWIT.pm  view on Meta::CPAN


=head2 $class->swit_send_http_header($r, $ct)

Sends HTTP default headers: session cookie and content type. C<$r> is apache
request and C<$ct> is optional content type (defaults to
C<text/html; charset=utf-8>.

=cut
sub swit_send_http_header {
	my ($class, $r, $ct) = @_;
	$r->pnotes('SWITSession')->end;
	$r->pnotes('SWITSession', undef);
	$r->content_type($ct || "text/html; charset=utf-8");
}

=head2 $class->swit_die($msg, $r, @data_to_dump)

Dies with first line of C<$msg> using Carp::croak and dumps request C<$r> and

 view all matches for this distribution


Apache-SdnFw

 view release on metacpan or  search on metacpan

lib/Apache/SdnFw.pm  view on Meta::CPAN


	$s->{r}{content} = <<END;
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	$favicon
$s->{r}{head}
</head>
<body $s->{r}{body}>
$s->{r}{content}

 view all matches for this distribution


Apache-Solr

 view release on metacpan or  search on metacpan

lib/Apache/Solr/JSON.pm  view on Meta::CPAN


sub request($$;$$)
{	my ($self, $url, $result, $body, $body_ct) = @_;

	if(ref $body && ref $body ne 'SCALAR')
	{	$body_ct ||= 'application/json; charset=utf-8';
		$body      = \$self->json->encode($body);
	}

	# Solr server 3.6.2 seems not to detect the JSON input from the
	# body content, so requires this work-around

 view all matches for this distribution


Apache-TS-AdminClient

 view release on metacpan or  search on metacpan

lib/Apache/TS/AdminClient.pm  view on Meta::CPAN

 proxy.config.http.cache.guaranteed_min_lifetime
 proxy.config.http.cache.heuristic_lm_factor
 proxy.config.http.cache.heuristic_max_lifetime
 proxy.config.http.cache.heuristic_min_lifetime
 proxy.config.http.cache.http
 proxy.config.http.cache.ignore_accept_charset_mismatch
 proxy.config.http.cache.ignore_accept_encoding_mismatch
 proxy.config.http.cache.ignore_accept_language_mismatch
 proxy.config.http.cache.ignore_accept_mismatch
 proxy.config.http.cache.ignore_authentication
 proxy.config.http.cache.ignore_client_cc_max_age

 view all matches for this distribution


Apache-Tika

 view release on metacpan or  search on metacpan

lib/Apache/Tika.pm  view on Meta::CPAN

	);

	# Check for errors
	# TODO

	return decode_utf8($response->decoded_content(charset => 'none'));
}

sub meta {
	my ($self, $bytes, $contentType) = @_;
	my $meta = $self->_request(

 view all matches for this distribution


Apache-TinyCP

 view release on metacpan or  search on metacpan

examples/templates/layout  view on Meta::CPAN

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>mysite.com :: [% title %]</title>
    <link rel="shortcut icon" href="/images/favicon.png" type="image/png"/>
    <link rel="stylesheet" href="/css.css" title="Simple" />
  </head>
  <body>

 view all matches for this distribution


Apache-UploadMeter

 view release on metacpan or  search on metacpan

lib/Apache/UploadMeter/Resources/JavaScript.pm  view on Meta::CPAN

      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
    };

    if (this.method == 'post') {
      headers['Content-type'] = this.options.contentType +
        (this.options.encoding ? '; charset=' + this.options.encoding : '');

      /* Force "Connection: close" for older Mozilla browsers to work
       * around a bug where XMLHttpRequest sends an incorrect
       * Content-length header. See Mozilla Bugzilla #246651.
       */

 view all matches for this distribution


Apache-WebDAV

 view release on metacpan or  search on metacpan

lib/Apache/WebDAV.pm  view on Meta::CPAN

    # Update: this happens if you connect with a regular browser, or if you
    # connect using IE but don't check the Web Folder box.  So just print a
    # warning.
    elsif($handler->test('d', $path))
    {
        $r->content_type('text/html; charset="utf-8"');
        $r->send_http_header();
        $r->print("If you are using IE, please use File -> Open and check the
                   Open As Web Folder box.");
    }
    else

lib/Apache/WebDAV.pm  view on Meta::CPAN

    {
        $r->header_out('Last-Modified', $handler->modtime($path));
    }
    elsif($handler->test('d', $path))
    {
        $r->content_type('text/html; charset="utf-8"');
        $r->send_http_header();
    }
    else
    {
        return NOT_FOUND;

lib/Apache/WebDAV.pm  view on Meta::CPAN

    {
        return NOT_FOUND;
    }

    $r->status(207);
    $r->content_type('text/xml; charset="utf-8"');

    my @files;

    if($depth == 0)
    {

lib/Apache/WebDAV.pm  view on Meta::CPAN


        $multistat->addChild($response);
    }

    $r->status(207);
    $r->content_type('text/xml; charset="utf-8"');
    $r->send_http_header();

    if(!$r->header_only())
    {
        $r->print($doc->toString(1));

 view all matches for this distribution


Apache-Wyrd

 view release on metacpan or  search on metacpan

Wyrd/Form.pm  view on Meta::CPAN

	$default =~ s/\/$remove_form$//;
	$default .= "/" . $self->{'_current_form'} unless ($self->_flags->no_grow);
	my $action = ($self->{'_action_index'}->{$self->{'_current_form'}} || $self->{'action'} || $default);
	my $method = ($self->{'method'} || 'post');
	my $extra_attributes = '';
	foreach my $attribute (qw(enctype accept-charset onsubmit)) {
		my $attribute_value = $self->{$attribute};
		if ($attribute_value) {
			$extra_attributes .= qq( $attribute="$attribute_value");
		}
	}

 view all matches for this distribution


Apache-XPointer-RDQL

 view release on metacpan or  search on metacpan

lib/Apache/XPointer/RDQL/RDFStore.pm  view on Meta::CPAN

=over 4

=item * B<multipart/mixed>

 --match
 Content-type: text/xml; charset=UTF-8

 <rdf:RDF
      xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
      xmlns:rdfstore='http://rdfstore.sourceforge.net/contexts/'
      xmlns:voc0='http://purl.org/rss/1.0/'>

lib/Apache/XPointer/RDQL/RDFStore.pm  view on Meta::CPAN

   <voc0:link>http://feeds.feedburner.com/BenHammersleysDangerousPrecedent?m=1</voc0:link>
  </rdf:Description>
 </rdf:RDF>

 --match
 Content-type: text/xml; charset=UTF-8

 <rdf:RDF
      xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
      xmlns:rdfstore='http://rdfstore.sourceforge.net/contexts/'
      xmlns:voc0='http://purl.org/rss/1.0/'>

lib/Apache/XPointer/RDQL/RDFStore.pm  view on Meta::CPAN


	    $model->add($factory->createStatement($subject,$property,$object));
	} @{$res->{'bind'}};

	$apache->print(qq(--match\n));
	$apache->print(sprintf("Content-type: text/xml; charset=%s\n\n","UTF-8"));

	$apache->print(sprintf("%s\n",$model->serialize()));
    }

    $apache->print(qq(--match--\n));

 view all matches for this distribution


Apache-XPointer

 view release on metacpan or  search on metacpan

lib/Apache/XPointer/XPath.pm  view on Meta::CPAN

=over 4

=item * B<multipart/mixed>

 --match
 Content-type: text/xml; charset=UTF-8

 <foo xmlns="x-urn:example:foo" xmlns:baz="x-urn:example:baz">
  <baz:bar>hello</baz:bar>
 </foo>

 --match
 Content-type: text/xml; charset=UTF-8

 <foo xmlns="x-urn:example:foo" xmlns:baz="x-urn:example:baz">
  <baz:bar>world</baz:bar>
 </foo>

lib/Apache/XPointer/XPath.pm  view on Meta::CPAN


	    $root->addChild($child);
	}

	$apache->print(qq(--match\n));
	$apache->print(sprintf("Content-type: text/xml; charset=%s\n\n",$res->{'encoding'}));
	$apache->print($root->toString(1,1));
	$apache->print(qq(\n));
    }

    $apache->print(qq(--match--\n));

 view all matches for this distribution


Apache2-API

 view release on metacpan or  search on metacpan

lib/Apache2/API.pm  view on Meta::CPAN

    }

    # Choose Content-Type
    # If we use new modern error, then we set application/problem+json in line with rfc7807
    my $ctype = ( $is_error && $use_rfc_error )
        ? 'application/problem+json; charset=utf-8'
        : 'application/json; charset=utf-8';
    $resp->content_type( $ctype );

    # $r->status( $code );
    $resp->code( $code );
    if( defined( $msg ) && $ctype !~ m{^application/(?:json|problem\+json)}i )

 view all matches for this distribution


Apache2-ASP

 view release on metacpan or  search on metacpan

lib/Apache2/ASP/ErrorHandler.pm  view on Meta::CPAN


  my $msg = <<"ERROR";
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>500 Server Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
HTML,BODY {
  background-color: #FFFFFF;
}
HTML,BODY,P,DIV {

 view all matches for this distribution


Apache2-Ajax

 view release on metacpan or  search on metacpan

lib/Apache2/Ajax.pm  view on Meta::CPAN

the I<Content-Type>, for which I<text/html> is used.
If additional headers are required, they may
be passed as an optional argument in the
form of a hash reference, as in

  my $header = {'Content-Type' => 'text/html; charset=utf-8',
		'X-err_header_out' => 'err_headers_out',
	       };
  my $ajax = Apache2::Ajax->new($r);
  my $html = $ajax->build_html(header => $header);

 view all matches for this distribution


Apache2-AuthAny

 view release on metacpan or  search on metacpan

examples/demo-gate/gate.php  view on Meta::CPAN

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>AuthAny Login</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="gate.css" />
  </head>

  <body id="gateBody">
    <h1>Apache2::AuthAny Example GATE</h1>

 view all matches for this distribution


Apache2-AuthenNTLM

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

     alive request.

 0.15  9. Apr 2002

   - Added patch from Brian Paulsen which causes correct handling of
     non unicode charset (needed for some versions of win9x) and
     more verbose debugging output (decoded flags)

 0.14  26. Feb 2002

   - fixed a problem that page content of Perl sometimes goes to the

 view all matches for this distribution


Apache2-AutoIndex-XSLT

 view release on metacpan or  search on metacpan

lib/Apache2/AutoIndex/XSLT.pm  view on Meta::CPAN

		}

		# Send the appropriate content type
		my $content_type = $render
					? 'text/html'
					: 'text/xml; charset="utf-8"';
		$r->content_type($content_type);
		return Apache2::Const::OK if $r->header_only;

		# The dir_xml subroutine will actually print and output
		# all the XML DTD and XML, returning an OK if everything

 view all matches for this distribution


Apache2-Autocomplete

 view release on metacpan or  search on metacpan

lib/Apache2/Autocomplete.pm  view on Meta::CPAN

the I<Content-Type>, for which I<text/html> is used.
If additional headers are required, they may
be passed as an optional argument into I<run()>in the
form of a hash reference, as in

  my $header = {'Content-Type' => 'text/html; charset=utf-8',
		'X-err_header_out' => 'err_headers_out',
	       };
  $ac->run($header);

=item * my $r = $ac-E<gt>r;

 view all matches for this distribution


Apache2-ClickPath

 view release on metacpan or  search on metacpan

t/session/003output_body.t  view on Meta::CPAN

open F, ">t/htdocs/tmp/y.html" and print F <<"EOF";

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
		<meta HTTP-EQUIV=REFRESH CONTENT="0; URL=/klaus/view/index.shtml">
	</head>

	<body>
		<center>

 view all matches for this distribution


Apache2-DirBasedHandler-TT

 view release on metacpan or  search on metacpan

lib/Apache2/DirBasedHandler/TT.pm  view on Meta::CPAN

      return $self->process_template(
          $r,
          $$args{'tt'},
          $$args{'vars'},
          qq[blurb.tmpl],
          qq[text/plain; charset=utf-8],
      );
  }
  
  sub super_page {
      my $self = shift;

lib/Apache2/DirBasedHandler/TT.pm  view on Meta::CPAN

      return $self->process_template(
          $r,
          $$args{'tt'},
          $$args{'vars'},
          qq[blurb.tmpl],
          qq[text/plain; charset=utf-8],
      );
  }

  sub super_dooper_page {
      my $self = shift;

lib/Apache2/DirBasedHandler/TT.pm  view on Meta::CPAN

      return $self->process_template(
          $r,
          $$args{'tt'},
          $$args{'vars'},
          qq[blurb.tmpl],
          qq[text/plain; charset=utf-8],
      );
  }

  1;

 view all matches for this distribution


Apache2-DirBasedHandler

 view release on metacpan or  search on metacpan

lib/Apache2/DirBasedHandler.pm  view on Meta::CPAN


sub root_index {
    return (
        Apache2::Const::OK,
        q[you might want to override "root_index"],
        'text/html; charset=utf-8'
    );
}

sub set_debug {
    $debug = shift;

lib/Apache2/DirBasedHandler.pm  view on Meta::CPAN

      }

      return (
          Apache2::Const::OK,
          qq[this is the index],
          qq[text/plain; charset=utf-8]
      );
  }

  sub super_page {
      my $self = shift;
      my ($r,$uri_args,$args) = @_;

      return (
          Apache2::Const::OK,
          qq[this is $location/super and all it's contents],
          qq[text/plain; charset=utf-8]
      );
  }

  sub super_dooper_page {
      my $self = shift;
      my ($r,$uri_args,$args) = @_;

      return (
          Apache2::Const::OK,
          qq[this is $location/super/dooper and all it's contents],
          qq[text/plain; charset=utf-8]
      );
  }

  1;

 view all matches for this distribution


Apache2-EmbedMP3

 view release on metacpan or  search on metacpan

lib/Apache2/EmbedMP3.pm  view on Meta::CPAN

			} else {
				return Apache2::Const::FORBIDDEN;
			}
		} else {
			my $md5 = md5_hex($r->filename);
			$r->content_type("text/html; charset=utf-8");

			my $template = $r->dir_config('template');
			my $wpaudioplayer = $r->dir_config("wpaudioplayer");

			my $t = Apache2::EmbedMP3::Template->new($template);

 view all matches for this distribution


Apache2-Filter-Minifier-CSS

 view release on metacpan or  search on metacpan

t/MY/CharsetHandler.pm  view on Meta::CPAN

use File::Spec::Functions qw(catfile);
use File::Slurp qw(slurp);

sub handler {
    my $r = shift;
    $r->content_type('text/css; charset=iso-8859-1');
    $r->print( slurp(catfile($r->document_root,'test.css')) );
    return Apache2::Const::OK;
}

1;

 view all matches for this distribution


Apache2-Filter-Minifier-JavaScript

 view release on metacpan or  search on metacpan

t/MY/CharsetHandler.pm  view on Meta::CPAN

use File::Spec::Functions qw(catfile);
use File::Slurp qw(slurp);

sub handler {
    my $r = shift;
    $r->content_type('text/javascript; charset=iso-8859-1');
    $r->print( slurp(catfile($r->document_root,'test.js')) );
    return Apache2::Const::OK;
}

1;

 view all matches for this distribution


Apache2-HTML-Detergent

 view release on metacpan or  search on metacpan

lib/Apache2/HTML/Detergent.pm  view on Meta::CPAN

    my $ctx;
    unless ($ctx = $f->ctx) {
        # turns out some things don't have a type!
        my $x = $r->content_type || '';
        my ($t, $c) =
            ($x =~ /^\s*([^;]*)(?:;.*?charset\s*=\s*['"]*([^'"]+)['"]*?)?/i);

        $ctx = [$t || 'application/octet-stream', ''];
        $f->ctx($ctx);
    }

lib/Apache2/HTML/Detergent.pm  view on Meta::CPAN


    # application/xml is the most reliable content type to
    # deliver to browsers that use XSLT.
    if ($config->xslt) {
        $r->log->debug("forcing $type -> application/xml");
        $r->content_type('application/xml; charset=utf-8');
    }

    # XXX will we need to restore $r->status == 200 to this condition?
    if ($r->is_initial_req) {
        # BEGIN BUCKET

lib/Apache2/HTML/Detergent.pm  view on Meta::CPAN

                $doc->insertBefore($pi, $root);
            }
        }
    }
    else {
        $r->content_type(sprintf '%s; charset=utf-8', $type);
    }
    #$r->log->debug($r->content_encoding || 'identity');
    #$r->log->debug($r->headers_in->get('Content-Encoding'));

    # reuse content

 view all matches for this distribution


Apache2-HttpEquiv

 view release on metacpan or  search on metacpan

lib/Apache2/HttpEquiv.pm  view on Meta::CPAN


  my $content_type;

  while ($token = $p->get_token) {
    if ($token->[0] eq 'meta') {
      if ($header = $token->[1]{'charset'} and not defined $content_type) {
        $content_type = "text/html; charset=$header";
      } # end if <meta charset=...>
      elsif ($header = $token->[1]{'http-equiv'}) {
        if ($header eq 'Content-Type' and not defined $content_type) {
          $content_type = $token->[1]{content};
          # text/xhtml is not a valid content type:
          $content_type =~ s!^text/xhtml(?=\s|;|\z)!text/html!i;

lib/Apache2/HttpEquiv.pm  view on Meta::CPAN


=head1 DESCRIPTION

Apache2::HttpEquiv provides a PerlFixupHandler for mod_perl 2 that turns
C<< <meta http-equiv="Header-Name" content="Header Value"> >> into an actual
HTTP header.  It also looks for C<< <meta charset="..."> >> and uses it to
set the Content-Type to C<text/html; charset=...>.

If the file claims its Content-Type is 'text/xhtml', the Content-Type
is set to 'text/html' instead.  'text/xhtml' is not a valid
Content-Type, and any file that claims it is probably too broken to
parse as 'application/xhtml+xml'.

 view all matches for this distribution


Apache2-ModXml2

 view release on metacpan or  search on metacpan

examples/xml2_test.html  view on Meta::CPAN

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- $Id: xml2_test.html 31 2011-10-25 19:24:53Z jo $ -->
<HTML
  xmlns:ns="http://nonsense/"><HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="AUTHOR" CONTENT="jo ">
	<META NAME="CREATED" CONTENT="20110629;13131700">
	<META NAME="CHANGEDBY" CONTENT="jo ">

 view all matches for this distribution


Apache2-POST200

 view release on metacpan or  search on metacpan

lib/Apache2/POST200.pm  view on Meta::CPAN


    $r->status( Apache2::Const::REDIRECT );
    $r->status_line( Apache2::RequestUtil::get_status_line(Apache2::Const::REDIRECT) );
    $r->headers_out->clear;
    $r->err_headers_out->clear;
    $r->content_type( 'text/html; charset=iso-8859-1' );
    $r->headers_out->{'Content-Length'}=length $msg;
    $r->headers_out->{'Location'}=$loc;

    $f->ctx( {
	      dbh=>$dbh,

 view all matches for this distribution


Apache2-PageKit

 view release on metacpan or  search on metacpan

lib/Apache2/PageKit.pm  view on Meta::CPAN

  my $browser_cache =  $config->get_page_attr($page_id,'browser_cache') || $pk->{browser_cache} || 'yes';
  $apr->headers_out->{'Expires'} = '-1' if $apr->param('pkit_logout') || $browser_cache eq 'no' || $apr->user;

  my $content_type = $output_media;
  
  my $default_output_charset = $view->{default_output_charset};
  my @charsets = ();
  if($output_media eq 'text/html'){
    # first get accepted charsets from incoming Accept-Charset HTTP header
    if(my $accept_charset = $apr->headers_in->{'Accept-Charset'}){
      my @quality = split(/\s*;\s*/, $accept_charset);
      my @accept_charsets = split(/\s*,\s*/, shift @quality);
      my $pos = 0;
      for ( @accept_charsets ) {
        s/^(iso|utf)/\U$1/;
        s/^(us\-)?ascii/US-ASCII/;
	$quality[$pos] =~ /^q=(\d+(?:\.\d+)?)/;
	push @charsets, [ $_, $1 || '0.1', $pos++ ];
      }
      @charsets = sort {$b->[1] <=> $a->[1] || $a->[2] <=> $b->[2] } @charsets;
     
     # set a content-type perhaps we overwrite this later if we know about the charset for the output pages
    }
  } elsif ($output_media eq 'application/pdf'){
    
    my $fop_command = $config->get_server_attr('fop_command') 
      || $config->get_global_attr('fop_command');

lib/Apache2/PageKit.pm  view on Meta::CPAN


  # call output filter, if applicable
  $model->pkit_output_filter($output_ref)
    if $model->can('pkit_output_filter');

  my ( $converted_data, $retcharset );
  if ($output_media eq 'text/html'){
    my $data;
    while (@charsets){
      $retcharset = (shift @charsets)->[0];
      eval {
        $converted_data = Encode::encode($retcharset, $$output_ref, Encode::FB_CROAK );
      };
      last unless ($@);
      $retcharset = undef;
    }

    ## here no action is needed, if we did not convert the data to anything usefull.
    ## we deliver in our default_output_charset.

    # correct the header
    if ($retcharset) {
      $content_type = "text/html; charset=$retcharset";
    }
    else {
      $content_type = "text/html; charset=$default_output_charset";
      $converted_data = Encode::encode( $default_output_charset, $$output_ref,Encode::FB_DEFAULT );
    }
    # it is already "text/html"
  }

  # only pages with propper $retcharset are tranfered gzipped.
  # this can maybe changed!? Needs some tests
  my $send_gzipped = ( $retcharset && $pk->{use_gzip} eq 'all' );
  $apr->content_encoding('gzip') if ($send_gzipped);

  $apr->content_type($content_type) unless $apr->main;

  if ($send_gzipped) {

lib/Apache2/PageKit.pm  view on Meta::CPAN

  }

  $self->{dbh} = $model->pkit_dbi_connect if $model->can('pkit_dbi_connect');

  my $default_lang = $config->get_global_attr('default_lang') || 'en';
  my $default_input_charset = $config->get_global_attr('default_input_charset') || 'ISO-8859-1';
  my $default_output_charset = $config->get_global_attr('default_output_charset') || 'ISO-8859-1';
  my $html_clean_level = $config->get_server_attr('html_clean_level') || 0;
  my $can_edit = $config->get_server_attr('can_edit') || 'no';
  my $reload = $config->get_server_attr('reload') || 'no';

  my $cache_dir = $config->get_global_attr('cache_dir');

lib/Apache2/PageKit.pm  view on Meta::CPAN

					     root_dir => $pkit_root,
  					     view_dir => "$pkit_root/View",
					     content_dir => "$pkit_root/Content",
					     cache_dir => $view_cache_dir,
					     default_lang => $default_lang,
					     default_input_charset => $default_input_charset,
					     default_output_charset => $default_output_charset,
					     reload => $reload,
					     html_clean_level => $html_clean_level,
					     input_param_object => $apr,
					     output_param_object => $self->{output_param_object},
					     can_edit => $can_edit,

 view all matches for this distribution


( run in 2.540 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )