Maximum points to the expert who solves this problem, which has stumped my hosting service tech support and me after a week of struggling.
Problem: Japanese form input inserted into a MySQL database appears garbled on the hosting server (hereinafter "Server"), although it appears as readable Japanese when I do the same operation on my testing machine ("Local").
Factors: The input form and the processing script are constant. So are the MySQL character sets and collations: UTF-8 and utf8_unicode_ci, respectively, in all categories. The PHP and Apache settings probably differ in various ways. I've tried managing PHP with a php.ini file containing multibyte-related lines in my /scripts directory. Not only does that have no effect, but the php.ini on Local contains no such lines anyway. The Content-Type of my input page is "text/html; charset=utf-8". The PHP/MySQL installations are the same major versions: PHP 4.4.6 and MySQL 4.1.22-standard on Server, versus PHP 4.3.6 and MySQL 4.1.7-nt on Local. Server runs Unix, and Local runs Windows XP SP2 (Japanese).
When Japanese is typed directly into the MySQL db, or contained in data that's copied by SQL in phpMyAdmin, the problem does not occur. Since the input form and script work on Local, I'm assuming they're not at fault and am omitting them here. However, I'll supply them as necessary. I've tried html_entity_decode, SET NAMES, and more, all in vain. Here is a sample of the garbled Japanese, pasted from the db: æ¥æS¬èª~
In case that's not visible to all, it's a mixture of international phonetic symbols, non-English language symbols such as a French accent grave, and non-language symbols. In other words, it's not html entities or question marks.
Lacking a solution to this problem per se, I'd like to know whether I can dispose of it by upgrading my hosting account to PHP5/MySQL5, along with any vital details about making the transition and setting up MBCS support. I'm already using PHP/MySQL heavily on my sites and can't afford to go down for long. Since my (otherwise outstanding) hosting service doesn't understand what's causing the problem at hand, I'd like an outside opinion on this.