Page 1 of 2

Still problems with the € sign

Posted: Tue Feb 02, 2010 7:14 pm
by lupolo
Here is the encode whithin my language file:

/* Change the language name and encoding to your own language */
$hesklang['LANGUAGE']='Nederlands';
$hesklang['ENCODING']='ISO-8859-1';

But the script still breaks the € sign, what else could I check? The Demo site works fine?!

Posted: Tue Feb 02, 2010 8:33 pm
by Klemen
Create a ticket and post the link to the problematic ticket to see exactly how the problem looks.

Posted: Tue Feb 02, 2010 9:16 pm
by lupolo
The text i entered:

"Here is the test with the € sign!"

The link:

http://www.ace-europe.nl/helpdesk/ticke ... U6HRX3VP4P

Posted: Tue Feb 02, 2010 9:27 pm
by Klemen
Strange one. No idea what this is. Maybe a server-side security rules of some sort (no idea what)?

As you already know, the demo works fine:
http://www.hesk.com/demo/ticket.php?track=VAVLYNE6PE

Try saving this code as "etest.php", upload to your server, open in browser, submit window and let me know what it says:

Code: Select all

<html>

<head>
  <title>Test</title>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
</head>

<body>


<form method="post" action="etest.php">
<input type="text" name="euro" value="Here is the test with the € sign!">
<input type="submit">
</form>

<p>&nbsp;</p>

<?php
if (!empty($_POST['euro']))
{
	$euro = $_POST['euro'];

    echo "POST RESULTS:<br><br>";
    echo "Unprocessed: $euro<br>";

	$euro = htmlspecialchars($euro);
    echo "Process 1: $euro<br>";

	$euro = preg_replace('/&(\#[0-9]+;)/','&$1',$euro);
    echo "Process 2: $euro<br>";
}
?>

</body>

</html>

Posted: Tue Feb 02, 2010 9:32 pm
by lupolo
Looks good:

POST RESULTS:

Unprocessed: €
Process 1: €
Process 2: €

http://www.ace-europe.nl/helpdesk/etest.php

Is the ISO only in the language file?

(also have it wenn i select the Englisch and German language)

Posted: Tue Feb 02, 2010 9:37 pm
by lupolo
Maybe use:


$euro = preg_replace('/&(\#[0-9]+;)/','&$1',$euro);

Before it writes into the MYSQL: € convert to Euro

Posted: Tue Feb 02, 2010 9:40 pm
by Klemen
You should delete the test file.

So it looks like MySQL is the problem. Try adding this line in the inc/common.inc.php file:

Code: Select all

$in = str_replace('€','&euro;',$in);      
add it just below

Code: Select all

$in = preg_replace('/&(\#[0-9]+;)/','&$1',$in);

Posted: Tue Feb 02, 2010 9:41 pm
by Klemen
That strange character is the € sign, looks like some problems here too :wink:

Posted: Tue Feb 02, 2010 9:48 pm
by lupolo
haha ;)

Great The Fix worked for me! Iám Happy and going to bed now! Many thanks for the help!

http://www.ace-europe.nl/helpdesk/ticke ... B4134AS5YL

have removed the test file!

Posted: Tue Feb 02, 2010 10:22 pm
by Henrie
Btw lupolo,

You should look at the code of your hesk footer. Seems the header of your normal pages

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Footer</title>
<style type="text/css">
<!--
.style1 {
	font-size: 14px;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #000000;
}
-->
</style>
</head>

<body>
<div align="center">
  <p>&nbsp;</p>

  <p><a href="http://www.islonline.net/start/ISLLightClient?custom=ace-europe-nl" class="style1">Remote Support</a></p>
</div>
is added as the footer to your hesk page.

Greetings,
Henrie

Posted: Wed Feb 03, 2010 7:07 am
by lupolo
This is oke, i have added this my self in the footer.txt

Posted: Wed Feb 03, 2010 6:11 pm
by Henrie
Well, this will break the valid xhtml code of the page and could possibly cause troubles with the page in some browers.
There are better ways to add this code to your page, that doesn't break the valid xhtml code.

If it is for the Remote Support link, you could add the following valid code

Code: Select all

<div>
  <p>&nbsp;</p>
  <p  style="text-align: center;"><a href="http://www.islonline.net/start/ISLLightClient?custom=ace-europe-nl" style="font-size: 14px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">Remote Support</a></p>
</div> 
Greetings,
Henrie

Posted: Thu Feb 04, 2010 9:32 am
by lupolo
Henrie wrote:Well, this will break the valid xhtml code of the page and could possibly cause troubles with the page in some browers.
There are better ways to add this code to your page, that doesn't break the valid xhtml code.

If it is for the Remote Support link, you could add the following valid code

Code: Select all

<div>
  <p>&nbsp;</p>
  <p  style="text-align: center;"><a href="http://www.islonline.net/start/ISLLightClient?custom=ace-europe-nl" style="font-size: 14px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">Remote Support</a></p>
</div> 
Greetings,
Henrie
Have modified it! Thank you.

Posted: Wed Feb 17, 2010 4:44 pm
by lupolo
Klemen wrote:You should delete the test file.

So it looks like MySQL is the problem. Try adding this line in the inc/common.inc.php file:

Code: Select all

$in = str_replace('€','&euro;',$in);      
add it just below

Code: Select all

$in = preg_replace('/&(\#[0-9]+;)/','&$1',$in);
Can i also add the following:

Code: Select all

$in = str_replace('€','&euro;',$in);
$in = str_replace('<','<',$in);
$in = str_replace('>','>',$in);
$in = str_replace('&','&',$in);
$in = str_replace('"','"',$in);
$in = str_replace('“','&ldquo;',$in);
$in = str_replace('”','&rdquo;',$in);
$in = str_replace('‘','&lsquo;',$in);
$in = str_replace('’','&rsquo;',$in);
$in = str_replace('€','&euro;',$in);
$in = str_replace(' ','&nbsp;',$in);
$in = str_replace('©','&copy;',$in);
$in = str_replace('®','&reg;',$in);
$in = str_replace('™','&trade;',$in);
$in = str_replace('¨','&uml;',$in);
$in = str_replace('§','&sect;',$in);
$in = str_replace('¹','&sup1;',$in);
$in = str_replace('²','&sup2;',$in);
$in = str_replace('³','&sup3;',$in);
$in = str_replace('¼','&frac14;',$in);
$in = str_replace('½','&frac12;',$in);
$in = str_replace('¾','&frac34;',$in);
$in = str_replace('°','&deg;',$in);
Because i have problemen with other characters also or is this not possible? What could be the problem that mine not work? My Domein en MySql?

See also http://www.degraeve.com/reference/specialcharacters.php

Posted: Wed Feb 17, 2010 9:25 pm
by Klemen
Give it a try. But this is not normal, it must be a problem with your MySQL.

You could also try changing all instances of htmlspecialchars to htmlentities in the common.inc.php file and see if that helps.