How to insert French characters to MySQL table on CodeIgniter?

Discussion in 'Programming' started by xrvel, Nov 8, 2010.

  1. #1
    I have a simple table (it uses "swedish_latin_ci" collation). I want to insert this string

    Digsby est un client multiprotocole de messagerie instantanée qui vous permet de parler avec tous vos amis sur AIM, MSN, Yahoo, ICQ, Google Talk et Jabber avec une liste de contacts simple à gérer.​

    When i insert it from normal PHP code, it works well.
    But when i insert it by Code Igniter, french characters are replaced by ? automatically.
    How to solve this?
     
    xrvel, Nov 8, 2010 IP
  2. imocoder

    imocoder Member

    Messages:
    45
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Before you run your query, you should run this query first:
    
    SET NAMES 'utf8'
    
    Code (markup):
     
    imocoder, Nov 13, 2010 IP