Display correctly Greek and special characters

Thread Solved

Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Display correctly Greek and special characters

 
0
  #1
Sep 20th, 2008
I have a problem with my project.
The project search through the database and displays the results.
The problem is that I get question marks instead of GREEK letters (i do not mean rubbish, i mean Greek).
Suppose that the problem is not about encoding.
I have to find the command that displays the title of the product into the results page.
I finally found this :

  1. $tplv['id']=$row['id'];
  2. $tplv['high']=$ISHIGHLIGHTED;
  3. $tplv['bold']=$ISBOLD;
  4. $tplv['idformat']="<A HREF=\"".$SETTINGS['siteurl']."item.php?id=".$row['id']."\">";
  5. if($ISHIGHLIGHTED) {
  6. $tplv['idformat'] .= "<SPAN CLASS=hg>";
  7. }
  8. if($ISBOLD) {
  9. $tplv['idformat'] .= "<B>";
  10. }
  11.  
  12. $tplv['idformat'] .= stripslashes(htmlspecialchars($row['title']));
  13. if($ISBOLD) {
  14. $tplv['idformat'] .= "</B>";
  15. }
  16. if($ISHIGHLIGHTED) {
  17. $tplv['idformat'] .= "</SPAN>";
  18. }
  19. $tplv['idformat'].= "</FONT></A>";

I guess the problem is
  1. $tplv['idformat'] .= stripslashes(htmlspecialchars($row['title']));

Is there the right place to be?
Please get a view at http://gr2.php.net/htmlentities

I attach the file that includes the previous code.

Thank you
Attached Files
File Type: php browseitems.inc.php (4.6 KB, 1 views)
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Re: Display correctly Greek and special characters

 
0
  #2
Sep 20th, 2008
The problem is not the database. I do import it with utf8 and all pages are utf8 encoded plus i used the meta charset tag.

The problem is with one single line
$tplv['idformat'].= stripslashes(htmlspecialchars($row['title']));
and changed it to
$tplv['idformat'].= stripslashes(htmlspecialchars($row['title'], ENT_COMPAT, "UTF-8"));

but again nothing happens.

Also, when i edit a page(e.g. my welcome page) where i write greek letters, it displayed correctly.
If i edit it again , my greek letters (only in editing mode) are written like
& # and three numbers, all without spaces.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC