943,907 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 5191
  • MySQL RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Sep 20th, 2008
0

Re: Problem with Greek characters

Click to Expand / Collapse  Quote originally posted by Punkis448 ...
1. I saved the following to a html file. I uploaded in the sever and with default encoding Greek, it was displayed correctly. I changed browser encoding to UTF8 and i got question marks.
That's understandable, only one of them will work. Just a question: is the text really in Greek language? I don't know what your nationality is so I don't know if you're saying Greek meaning "some rubbish characters" or if you're saying Greek because it really is and should be Greek alphabet. (No offence here, people call dummy fill-in text "Lorem ipsum" "Greek".)

If you want to work with UTF-8 you have to work with UTF-8 only - you can't have a part in iso-8859-7 (or what is it that you have) and part in UTF-8. There's no point in saving from notepad in anything else than UTF-8, all of your HTML pages must be saved in UTF-8 etc.

For testing if the SQL is in UTF you don't have to upload it to server. Just change the extension to .html, open the file locally in your browser, change browser encoding do UTF and see what you got.


Click to Expand / Collapse  Quote originally posted by Punkis448 ...
A. To get the html code of all my pages, open it with notepad and encode it with utf8
B. To put the meta charset for utf8 to all of my pages. ( Have in mind that i did that for the pages that are used for the searching section, and also I did it with the combination of saving it with notepad in utf8 )
Well, you have to do both - all your files (that work with the UTF-8 content of your database) must both themselves be in UTF-8 and their meta charset must show that.
Reputation Points: 27
Solved Threads: 16
Junior Poster
petr.pavel is offline Offline
116 posts
since Mar 2008
Sep 20th, 2008
0

Re: Problem with Greek characters

Click to Expand / Collapse  Quote originally posted by Punkis448 ...
... I uploaded it and mysql displays it right. ...
You're being imprecise. What "mysql" displays it right? phpMyAdmin? or you're logged into MySQL using default command line client? If yes then what operating system you run the client on (Windows? Or do you connect to your server via ssh and there you run the command line client?) Your client or something along the way may translate the encoding so you have to provide exact information.

For instance, phpMyAdmin itself runs in some encoding (you can change that, you should be using UTF-8 - check in your browser). Then when you import using phpMyAdmin (you still didn't tell me what you use for importing) you tell phpMyAdmin what the source encoding is. The attribute you import to must also be in UTF-8 otherwise it would normally display rubbish but your browser might change its encoding based on content auto-detection without you even noticing it.

I hope you're not copy/pasting the sql into something that doesn't run in UTF-8...
Reputation Points: 27
Solved Threads: 16
Junior Poster
petr.pavel is offline Offline
116 posts
since Mar 2008
Sep 20th, 2008
0

Re: Problem with Greek characters

I do use Greek letters. My language is Greek.

I have found this link http://gr2.php.net/htmlentities is that useful ?
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008
Sep 20th, 2008
0

Re: Problem with Greek characters

I tried to find the file that does this work (as i said is not developed by me)
and found this :

MySQL Syntax (Toggle Plain Text)
  1. /* this subastas title and link to details */
  2. $tplv['id']=$row['id'];
  3. $tplv['idformat']="<A HREF=\"".$SETTINGS['siteurl']."item.php?id=".$row['id']."\">";
  4.  
  5. $tplv['idformat'] .= stripslashes(htmlspecialchars($row['title'])); $tplv['idformat'].= "</FONT></A>";


so i guess there must be something with this
MySQL Syntax (Toggle Plain Text)
  1. $tplv['idformat'] .= stripslashes(htmlspecialchars($row['title']));
Last edited by peter_budo; Sep 22nd, 2008 at 4:07 pm. Reason: Keep It Organized - please use [code] tags
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: join 2 tables with no common fields
Next Thread in MySQL Forum Timeline: SQL Injection





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC