Hi, I am creating a website in Turkish which was translating fine. I was editing each page and replacing English text with the turkish equivalent but when it came to extracting data from a database and then displaying it certain letters would not show, being replaced by a ?. The data displays fine in the database but not when displayed on page. Any ideas?
I post this with uncertainty, are you sure the font you're reading the site in supports Turkish characters. Not that I know anything about the language.
You'll need to take a look at how the data is stored. More specifically, the character set of the data going in as well as the data going out.
This would be my take as well. I would suspect the font used on the site doesn't have a turkish 'branch' installed. Though it could also be your character encoding, be it either what your server is declaring, what you are not declaring in your php via the header command, or that your database is storing in a different format than your document encoding. I would make sure your php is sending a UTF-8 header, make sure the document itself is set to UTF-8, and check that the font being used on the page is in fact capable of even displaying turkish characters. On windows machines you can only really rely on Arial, Courier New and Times New Roman providing alternate language support, and on other operating systems you are likely SoL unless the user has the language installed and is aware of the alternative language shortcomings (and no, including the 1 gig of language packs for OS X does NOT actually add font support!)
If I enter the data into the website statically all turkish characters are displayed. Dreamweaver converts each special character to the relvant code &co123; etc. When I take this from a database that conversion doesnt happen. It cannot be the font as it is possible to display the characters isnt it? What PHP header should I use, is this required as well as the html header.
HI $cattest = "Yönetim Danışmanlığı"; print $cattest; This is some code that I have entered into notepad. I have also added the following headers. header('Content-Type: text/plain; charset=ISO-8859-9'); - At top of php code <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /> - In head of html But.... The output of this is Yönetim Danışmanlığı Where does the problem lie?
Well, notepad saves as Windows-1252... web servers default to ISO-8859-1, and you want either UTF-8 or ISO-8859-9... Therin lies your problem. I would grab an editor with ISO-8859-9 or UTF-8 support, like Crimson Editor or Notepad++, and then make sure you have the correct encoding. As to dreamweaver do yourself a favor and pitch that rubbish in the trash.
Hi, Thanks for that but I do use notepad++ with the chracter coding of UTF8. I just said notepad for short. Any other clues of whats going on?