using drupal 7.4
the latest modul dev version.

i trie to change the content type of the printer-friendly site.
if i have a look (several "tools") with.. something like
http://web-sniffer.net/ it shows that the printer-page
is having a content-type: iso - ....

i will have there a content-type: utf-8 ..

i tried to change in my subtheme of zen (in a folder "sites/all/themes/mysubtheme/..."
tried "print.tpl.ph" ... tried with htaccess to get the content-type utf-8 ...

my hosting service i use is on a shared server, normally they have iso.

some hours..

i am not a coder, but with some time i will understand some little code elements
but i am not a programmer :)

so... where can i change "something" to get "utf-8" when clicking
on "sitename/?q=print/url-alias or node/xx"

mail will send it in utf-8

?? dont know what to do..

Comments

kifuzzy’s picture

datqabase is in utf8_generall_ci

edit:
tried in print-tpl.php in "sites/all/modules/print" something..

edit:
a page with "domain.xy/?q=alias" has the content - type "utf-8"
but when clicking "...=print/alias.. " the printer friendly page appears in "iso.."

edit:
uploaded a fresh installation (relative) of drupal 7.4
with wysiwyg and ckedtior librarie and some other
modules..

still the same.. but, when "flash all caches" .. it
shows the correct (an "ö" where an "ö" should be)
but some clicks later.. broken again.

tried
"AddDefaultCharset Off" in root-drupal .htaccess
"AddDefaultCharset utf-8 " but not working

the printer-friendly page is delivered in iso-... but not in utf-8.. content type

edit:
trying "boost" http://drupal.org/project/boost has no effects

kifuzzy’s picture

Category: feature » bug
Priority: Major » Normal
kifuzzy’s picture

ok - whatever i do - if clicking on "printer friedndly version" ..
firefox, internet explorer, chrome, safari for windows

are switching to - iso character set for the site and not utf-8

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

In my test-site: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

This comes from Drupal itself.

If your site has something different there, something is changing it. If you're talking about something else, please specify where you find this "iso-".

kifuzzy’s picture

http://test.mydomain.de/?q=print/3

with
one example

http-request-header
http-version:http1.1 / request-type: get

Connect to ip on port 80 ... ok

GET /?q=print%2F3 HTTP/1.1[CRLF]
Host: test.mydomain.de[CRLF]
Connection: close[CRLF]
User-Agent: Web-sniffer/1.0.37 (+http://web-sniffer.net/)[CRLF]
Accept-Encoding: gzip[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no-cache[CRLF]
Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
Referer: http://web-sniffer.net/[CRLF]
[CRLF]

with HTTP Response Header

Status: HTTP/1.1 200 OK
Date:	Wed, 20 Jul 2011 06:56:10 GMT	
Server:	Apache/2.2.3 (CentOS)	
Expires:	Sun, 19 Nov 1978 05:00:00 GMT	
Cache-Control:	no-cache, must-revalidate, post-check=0, pre-check=0	
ETag:	"1311144970"	
X-Generator:	Drupal 7 (http://drupal.org)	
Last-Modified:	Wed, 20 Jul 2011 06:56:10 GMT	
Connection:	close	
Transfer-Encoding:	chunked	
<strong>Content-Type:	text/html; charset=iso-8859-1</strong>

the page before, where the link to the printer-friendly is in the
link-section of node (page) at the bottom of - gives a "utf-8"
as "content-type",

the browsers switch to site-encoding "... iso..."
when clicking on this link - i could change it bymyself when i go over the
browser-menu and select the encoding "utf-8" by hand.

some of the output of the website, sourcecode of the
"printer-friendly-page" which switch to "iso-encoding"
in browsers

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <base href='http://test.mydomain.de/?q=content/%C3%A4-%C3%B6-%C3%B6' />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Ä Ö Ö</title>
    <script type="text/javascript" src="http://test.mydomain.de/misc/jquery.js?v=1.4.4"></script>
<script type="text/javascript" src="http://test.mydomain.de/misc/jquery.once.js?v=1.2"></script>
<script type="text/javascript" src="http://test.mydomain.de/misc/drupal.js?lolk4z"></script>
<script type="text/javascript" src="http://test.mydomain.de/sites/acquia/files/languages/de_8I3JN6QmnKqzS1z5tgIvFEhV8XywYB4r5dsBEEhQgPk.js?lolk4z"></script>
<script type="text/javascript" src="http://test.mydomain.de/sites/all/modules/views/js/jquery.ui.dialog.patch.js?lolk4z"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath":"\/","pathPrefix":"","ajaxPageState":{"theme":"bartik","theme_token":"Uw4LGZwXVNvvf4MrGEdZxDr7v0_JX40UdBfv3p7oRZ8","js":{"misc\/jquery.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1,"public:\/\/languages\/de_8I3JN6QmnKqzS1z5tgIvFEhV8XywYB4r5dsBEEhQgPk.js":1,"sites\/all\/modules\/views\/js\/jquery.ui.dialog.patch.js":1}}});
//--><!]]>
</script>
        <meta name='robots' content='noindex, nofollow' />
    <link rel='shortcut icon' href='http://test.mydomain.de/misc/favicon.ico' type='image/x-icon' />
    <style type="text/css" media="all">@import url("http://test.mydomain.de/modules/system/system.base.css?lolk4z");
@import url("http://test.mydomain.de/modules/system/system.menus.css?lolk4z");
@import url("http://test.mydomain.de/modules/system/system.messages.css?lolk4z");
@import url("http://test.mydomain.de/modules/system/system.theme.css?lolk4z");</style>
<style type="text/css" media="all">@import url("http://test.mydomain.de/modules/comment/comment.css?lolk4z");
@import url("http://test.mydomain.de/modules/field/theme/field.css?lolk4z");
@import url("http://test.mydomain.de/modules/node/node.css?lolk4z");
@import url("http://test.mydomain.de/modules/search/search.css?lolk4z");
@import url("http://test.mydomain.de/modules/user/user.css?lolk4z");
@import url("http://test.mydomain.de/sites/all/modules/views/css/views.css?lolk4z");</style>
<style type="text/css" media="all">@import url("http://test.mydomain.de/profiles/acquia/modules/ctools/css/ctools.css?lolk4z");
@import url("http://test.mydomain.de/sites/all/modules/print/css/print.css?lolk4z");</style>
  </head>
  <body>
....

it is a test-installation with
some ... :

acquia-drupal-7.4.4

modules in site/all/modules:

admin-menu
imce
imce-mkdir
imce-wysiwyg
libraries
print
views
wysiwyg

librarie:
ckeditor

its like that also in a zen-subtheme with a fully site online-ready and
some more modules or libraries.
or like in a basic drupal 7.4 installation with only some "article" and the
"print" module.

hmmm
think, its the server of my hoster?
try to change with print.tpl.php in the print-folder
try with .htaccess in the drupal-root
try with some "boost" - modul things in .htaccess
..

drupal make something i can not reproduce

every browser, when i click on the link
switch to "iso".

thx for your attention! :-)

greetings from germany

edit#
a includes/common.inc file looks like this
http://api.drupal.org/api/drupal/includes--common.inc/function/_drupal_d...

i tried something like
http://www.metaltoad.com/blog/how-change-content-type-meta-tag-drupal

but - i am not a coder... where to place?
i tried some.. but nothing works, happens..

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Active

You shouldn't have to tinker with that..

Those change the meta flag, which as you can see in the example you provided is correctly set to utf-8.

The problem here is the http header.

I expect that the Drupal bootstrap process calls:
drupal_set_header('Content-Type: text/html; charset=utf-8');

As it should during _drupal_bootstrap_full(). I need to check that this is being properly done.

kifuzzy’s picture

I expect that the Drupal bootstrap process calls:
drupal_set_header('Content-Type: text/html; charset=utf-8');

As it should during _drupal_bootstrap_full(). I need to check that this is being properly done.

i do not really understand what this means for me
or where to have look in which files.

or did you mean "during _drupal_bootstrap_full()." .. you have to look
somewhere in your files to reproduce or something like..?

drupal should deliver me the site in utf-8
like the nodes / pages i have - but it do not
deliver it when call the print.

do you mean "i (me) have to look" or do you will have a look?
do you need information?

sorry, i am a little confused.. one at the moment

jcnventura’s picture

Yes, I plan to take a look at it..

As I see it, when you call a drupal page, the bootstrap process begins and allows you to call modules. My code is executed because of that. During that bootstrap, the above line is called and should set the HTTP header to content-type utf-8.

After onfirming from your info that the meta data in the HTML is utf-8, it must be the http header that is setting it as iso.. Or else, it's something external to Drupal.

kifuzzy’s picture

yes :-) .. if i understand .. i am thinking about .. where to change the
header information or how to this information when
clicking on it.

so we will see :-) .. i take it from the page only visible for
admin or roles have right to see the "print-click-link"
.. so, the print_mail works fine.

i do not have tried the pdf - functionality, cause
i have to setup things for that in a virtual server
i have somewhere - but not really time.

i have some installation, or a test-area for me and my things
with only a maximum of 64 MB on a shared server - on other
installations .. others are "production" .. i do not test soemthing
there.

thank you!

thinking about the header, yes.

edit:
or .. something external to drupal

jcnventura’s picture

Status: Active » Fixed

It seems that the bootstrap process no longer sends the HTTP header in D7. I've added the necessary call to the print module.

kifuzzy’s picture

thank you - i will try it later and then change the status of this.

kifuzzy’s picture

Status: Fixed » Closed (fixed)

well done! and fast!
thank you very much indeed :-)

i tried the alpha-version of date 21.july.2011 and the header of
the printer-friendly-page ist now fine and the page is printer-friendly-ready :-)

lkrzak’s picture

Is this issue really resolved? I've installed the 7.x-1.0-beta1 and when viewing the printer-friendly page the browser switches to ISO and my native language characters are broken. Switching it manually to UTF-8 makes the page readible.

OFF’s picture

I have same problem with all versions of this module

mzwyssig’s picture

Status: Closed (fixed) » Active

Same here ! Currently using v.7.x-1.1

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Can you provide a URL to the pages in question?

mzwyssig’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Sorry, just saw this thread : http://drupal.org/node/1658760.

EDIT: jcnventura, I just sent you an email with a link.

Closing again.