| | |
Display correctly Greek and special characters
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: May 2008
Posts: 31
Reputation:
Solved Threads: 0
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 :
I guess the problem is
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
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 :
PHP Syntax (Toggle Plain Text)
$tplv['id']=$row['id']; $tplv['high']=$ISHIGHLIGHTED; $tplv['bold']=$ISBOLD; $tplv['idformat']="<A HREF=\"".$SETTINGS['siteurl']."item.php?id=".$row['id']."\">"; if($ISHIGHLIGHTED) { $tplv['idformat'] .= "<SPAN CLASS=hg>"; } if($ISBOLD) { $tplv['idformat'] .= "<B>"; } $tplv['idformat'] .= stripslashes(htmlspecialchars($row['title'])); if($ISBOLD) { $tplv['idformat'] .= "</B>"; } if($ISHIGHLIGHTED) { $tplv['idformat'] .= "</SPAN>"; } $tplv['idformat'].= "</FONT></A>";
I guess the problem is
PHP Syntax (Toggle Plain Text)
$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
•
•
Join Date: May 2008
Posts: 31
Reputation:
Solved Threads: 0
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.
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.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Setting a width to a photo displayed from MySQL doesnt work
- Next Thread: Text based mafia game
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion remote script search seo server sessions sms soap source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube





