Welcome Guest, Not a member yet? Register   Sign In
Chinese font was't supported by Cart Class?
#1

[eluser]Unknown[/eluser]
if I used this example,it's ok
Code:
$data = array(
               'id'      => 'sku_123ABC',
               'qty'     => 1,
               'price'   => 39.95,
               'name'    => 'T-Shirt',
               'options' => array('Size' => 'L', 'Color' => 'Red')
            );

$this->cart->insert($data);
But when I only change 'T-Shirt' to Chinese,it's faile
Code:
$data = array(
               'id'      => 'sku_123ABC',
               'qty'     => 1,
               'price'   => 39.95,
               'name'    => 'T恤',
               'options' => array('尺寸' => '大号', '颜色' => '红')
            );

$this->cart->insert($data);

Any idea?
Thanks m_ _m
#2

[eluser]Unknown[/eluser]
Use UTF-8 for all your scripts, database and html
#3

[eluser]Unknown[/eluser]
[quote author="AtPgaGa" date="1268183800"]Use UTF-8 for all your scripts, database and html[/quote]

Thank you~

Other Class,Such as Database Class,worked very smoothly.
Only Cart Class.

So,possibly,it was not a problem with charset.

In HTML
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

In CI config
Code:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

You remind me converted string,so I use this script:
Code:
'name'    => iconv("UTF-8", "ISO-8859-1//IGNORE", "T恤"), PHP_EOL,

But only "T" was transferred,"恤" was lost
#4

[eluser]Unknown[/eluser]
You can try again to change the file format of UTF - 8
#5

[eluser]Fatih[/eluser]
Please read this post. I tried and solved my problem with the last comment:
Code:
$this->product_name_rules = '\d\D';




Theme © iAndrew 2016 - Forum software by © MyBB