title: CodeIgniter charset to UTF-8
body: <p>I had a problem with inserting Arabic product names to Cart in CodeIgniter. That was fixed by overriding the <code>Cart.class</code> library <code>$product_name_rules</code> with <code>$this-&gt;cart-&gt;product_name_rules = "^."</code></p>
  
  <p>Now that works fine but there is another problem. It only works when I set <code>$db['default']['char_set'] = 'utf8';</code> in the database config file. Naturally this returns all strings from database as ????. If I change that utf8 to utf-8, it starts displaying the retrieved information correctly, but the cart refuses to work. </p>
  
  <p>What to do?<img src="https://i.stack.imgur.com/9EFeD.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/Wad8v.png" alt="enter image description here"></p>
  
  <p>it is either the cart works(utf-8 in database config) or the arabic works (utf8 in database)</p>