Internalizations in PHP (correct encoding/charset to support Japanese chars)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eros
    New Member
    • Jun 2007
    • 66

    Internalizations in PHP (correct encoding/charset to support Japanese chars)

    How to programming in PHP that supports Japanese characters.

    Problem: When I insert the data into database. The data inserted are garbage.

    Maybe there is configurations or code to be added at first.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you have to encode the data in the correct charset (e.g. utf-8 or shift-jis) before saving it to the DB, furthermore if the DB is set to the wrong charset (see DB table preferences) there might be problems too.
    For utf-8 you can use utf8_encode().

    Comment

    Working...