How to post Arabic characters in PHP

Posted by Peter Stuart on Stack Overflow See other posts from Stack Overflow or by Peter Stuart
Published on 2012-11-19T22:55:14Z Indexed on 2012/11/19 22:59 UTC
Read the original article Hit count: 288

Filed under:
|
|
|
|

Okay,

So I am writing an OpenCart extension that must allow Arabic characters when posting data.

Whenever I post ????? the print_r($_POST) returns with this: u0645u0631u062du0628u0627

I check the HTML header and it has this:

<meta charset="UTF-8" />

I checked the PHP file that triggers all SQL queries and it has this code:

mysql_query("SET NAMES 'utf8'", $this->link);
mysql_query("SET CHARACTER SET utf8", $this->link);
mysql_query("SET CHARACTER_SET_CONNECTION=utf8", $this->link);

This is in my form tag:

<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form" accept-charset="utf-8">

I can't think of what else I am doing wrong. The rest of the OpenCart framework supports UTF8 and arabic characters. It is just in this instance where I can't post anything arabic?

Could someone please help me?

Many Thanks

Peter

© Stack Overflow or respective owner

Related posts about php

Related posts about forms