I have a table that has about 200K rows of data. Overall it works great. I have two different pages where users can submit data to be inserted into this table. Both work fine, except when it comes to languages like Arabic. One continues to work fine however the other one inserts total gibberish. The PHP code in both cases is almost identical.
The page that woks fine submits data to a PHP script via form POST. When I check for the encoding type of the data it shows as ASCII.
The page that is acting up uses JS to submit data via ajax to another PHP script. When I check for data encoding on that page it shows as UTF-8.
Here's my table's info:
CREATE TABLE `uiCardCategories` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`project_id` INT(10) UNSIGNED NOT NULL,
`catCreator_id` INT(11) NULL DEFAULT NULL COMMENT 'id of the user who created this stack',
`catCreator_participantID` INT(11) NULL DEFAULT NULL COMMENT 'id of the participant who created this stack',
`label` VARCHAR(400) NOT NULL,
PRIMARY KEY (`id`, `project_id`),
INDEX `ix_uiCardCategories_project_creator_id` (`project_id`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
AUTO_INCREMENT=160880
;
I tested with the phrase "this is a test, in Arabic "هذا اختبار". Data in the table is:
هذا اختبار
What am I missing?