Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Possible Duplicate:
How to find web hosting that meets my requirements?

Is there any free host which supports php and mySQL queries in utf-8? I've already tried to use x10hosting and 000webhosting, but they don't support utf8 mysql queries (got mojibake). The default encoding of mysql in both sites is latin-1, and you're not able to change that.

Is there any other free host that fully supports utf-8?

share|improve this question
    
It looks like a duplicate, but the answer is different. You don't have to change your provider, tell the database at runtime what you expect. If you are using mysqli you could use this line $mysqli_db->set_charset("utf8"); to define the output of the queries. –  martinstoeckli Mar 23 '12 at 7:59
add comment

marked as duplicate by John Conde Mar 22 '12 at 10:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 1 down vote accepted

www.bplaced.net I have never tried it, but they offer phpmyadmin, so you can change settings manually. By the way, have you tried "set names 'utf8'"? E.g.:

$db=mysql_connect($db_host, $db_user, $db_password);
mysql_query("SET NAMES 'utf8'");
mysql_select_db($db_database, $db);
share|improve this answer
    
Alternatively, if you don't need to perform UTF string comparisons/manipulations in the database, you could just use a different encoding (e.g. punycode) for storage or simply store it as binary data. Also, you can use a single-byte character set like Latin-1 (ISO-8859) as an intermediate encoding. So display the text as UTF-8, but when you write to or query the database, just let MySQL treat the UTF-8 strings as Latin-1 strings. In most cases it shouldn't cause any problems as long as you stick to simple string functions (i.e. don't use TRIM or CONVERT or other charset-sensitive methods). –  Lèse majesté Mar 22 '12 at 9:00
    
Though I'd still try to do most of your string manipulation in PHP just to be safe. –  Lèse majesté Mar 22 '12 at 9:02
    
might want to look into this one. never used it myself but a couple of my mates have - freevirtualservers.com –  Theo G Mar 22 '12 at 11:55
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.