Still problems with the € sign

Helpdesk for my helpdesk software

Moderator: mkoch227

lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Still problems with the € sign

Post 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?!
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Create a ticket and post the link to the problematic ticket to see exactly how the problem looks.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post by lupolo »

The text i entered:

"Here is the test with the € sign!"

The link:

http://www.ace-europe.nl/helpdesk/ticke ... U6HRX3VP4P
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post 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>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post 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)
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post by lupolo »

Maybe use:


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

Before it writes into the MYSQL: € convert to Euro
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post 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);
Last edited by Klemen on Tue Feb 02, 2010 9:42 pm, edited 1 time in total.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

That strange character is the € sign, looks like some problems here too :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post 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!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post 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
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post by lupolo »

This is oke, i have added this my self in the footer.txt
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post 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
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post 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.
lupolo
Posts: 214
Joined: Mon Apr 20, 2009 2:12 pm

Post 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
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply