0

I have PHPLIST on my server which jammed with encoding Japanese fonts.

I installed foreign Language pack, but still cannot encode SHIFT-JIS and UTF-8.

How to correct PHP' s encoding in the files with encoding definition lines to correct encoding in each page PHP makes?

I think the problem is the script of the program which does not define encoding for each page, since the encoding correction of the version for the program.

NetStarter
  • 3,189
  • 7
  • 37
  • 48
john3825
  • 587
  • 1
  • 6
  • 14

1 Answers1

-1

2 possible source of problems: PHP script itself and database at the back (if any).

By sending the approiate header before any content has been sent to the client (simply speaking, headers must be sent at the beginning of your code as possible), the encoding could be "defined" by

<?php header('Content-Type: text/html; charset=utf-8');?>

EDIT!

Esailija gave a review and correction (see comments below) on my answer which is not correct for your question. As suggested by Esailija, you should check transmission encoding instead on the storage encoding itself.

My original answer is kept here as a "hall of shame".

Note that if you are using DBMS like MySQL, the encoding in the database should be set properly as well (utf8_general_ci recommended, backup your data completely before you applying any changes to the existing data and do it on an independent testing server first, as changing the encoding in your database could be a disaster).

KH.Lee
  • 142
  • 5
  • in MySQL, storage encoding is irrelevant to transmission encoding. You are just changing storage encoding, requiring a backup, and will end up with exactly the same problem because transmission encoding was not changed. As for the header, that doesn't define anything. It doesn't make your data utf-8, it just makes a claim that your data is utf-8 and that's it. – Esailija Apr 20 '13 at 10:34
  • Thanks for the comments. Lesson well learnt. I will update my answer accordingly. – KH.Lee Apr 20 '13 at 10:58
  • OK, I'm checking it on my PHPLIST program. What files do I have to put the META tag for the encoding? – john3825 Apr 20 '13 at 12:25
  • Seems it might be configurable, have you tried this one? http://forums.phplist.com/viewtopic.php?f=19&t=34666 – KH.Lee Apr 20 '13 at 12:48