I am using a hosting company to publish my sites, where I never had problems with encodings or similar compatibility issues. Currently I am working on Turkish characters in local Wamp and I bumped when I try to execute queries with tr.chars.
Readings:
- If I write Turkish characters in phpmyadmin for insert operation MySQL works perfect.
- If I insert Turkish values to the database via PHP code (with the header charset=utf-16,8,32 doesn't matter). It looks like gibberish in database.
- If I use tr characters in file_put_content function file name become gibberish.
- When PHP reads a gibberish chars from database it shows as normal.but filenames and values in database are still gibberish.
Stats:
- Collacation of table fields are; some utf32_turkish_ci some utf16_general_ciand some utf8_general_ci . All behave same.
- I added the header
header('Content-Type: text/html; charset=utf8');
16 and 32. Witout these, gibberish looks like gibberish in browser. With these, gibberish look like Turkish. - I added this header to root page that require() other pages.Nothing changed.
- I added this header to all the pages that require() or required by another page.Nothing changed.
- All file names are still gibberish whatever I try.
Whenever a Turkish character leaves the PHP and sent to an external program (file put content, execute_query), it gets distorted. So how can I ensure that all these systems collaborate with same encoding? And how I can spot where the problem is?