In order to get a translation and email piping and email sending working with UTF-8, I'm in a process of improving the encoding support of HESK 2.3. Getting all email headers working will take a little more effort, but anyway here's what I got so far. Outgoing Subject: line is fixed. Incoming From: address person name containing non-ASCII chars is still not done. The HTTP header changes allow UTF-8 charset to work in all PHP environments, servers and browsers.
My plan is to create also Finnish translations. 70% done. Will post later this spring.
The code below probably does not copy right, so get your patch from http://www.iki.fi/hyvatti/sw/hesk23-a.diff
Code: Select all
diff -ru /tmp/h/inc/email_functions.inc.php ./inc/email_functions.inc.php
--- /tmp/h/inc/email_functions.inc.php 2011-10-19 19:08:58.000000000 +0300
+++ ./inc/email_functions.inc.php 2012-01-05 08:42:37.320663615 +0200
@@ -48,6 +48,12 @@
function hesk_mail($to,$subject,$message) {
global $hesk_settings, $hesklang;
+ $subject2 = quoted_printable_encode($subject);
+ if ($subject2 != $subject) {
+ $subject2 = str_replace (' ', '_', $subject2);
+ $subject = "=?" . $hesklang['ENCODING'] . "?Q?${subject2}?=";
+ }
+
/* Use PHP's mail function */
if ( ! $hesk_settings['smtp'])
{
diff -ru /tmp/h/inc/header.inc.php ./inc/header.inc.php
--- /tmp/h/inc/header.inc.php 2011-09-15 21:36:06.000000000 +0300
+++ ./inc/header.inc.php 2011-12-19 07:07:28.107662879 +0200
@@ -35,9 +35,10 @@
/* Check if this is a valid include */
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
+header('Content-Type: text/html; charset='.$hesklang['ENCODING']);
?>
<!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" xml:lang="en" lang="en">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $hesk_settings['languages'][$hesk_settings['language']]['folder'] ?>" lang="<?php echo $hesk_settings['languages'][$hesk_settings['language']]['folder'] ?>">
<head>
<title><?php echo (isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?></title>
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>" />
diff -ru /tmp/h/print.php ./print.php
--- /tmp/h/print.php 2011-09-15 21:36:08.000000000 +0300
+++ ./print.php 2011-12-19 06:58:53.475662759 +0200
@@ -72,6 +72,7 @@
$sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` WHERE `replyto`='".hesk_dbEscape($ticket['id'])."' ORDER BY `id` ASC";
$res = hesk_dbQuery($sql);
$replies = hesk_dbNumRows($res);
+header('Content-Type: text/html; charset='.$hesklang['ENCODING']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
Regards,
Jaakko
Tel. +358 40 5011222